Skip to content

Commit

Permalink
[18.0] [IMP] follow up BLA-207 - add total weight / Volume on the pur…
Browse files Browse the repository at this point in the history
…chase order
  • Loading branch information
Mir028 committed Feb 5, 2025
1 parent 69c4286 commit 4df651c
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 61 deletions.
45 changes: 23 additions & 22 deletions purchase_order_weight_volume/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ Purchase Order Weight and Volume
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_order_weight_volume
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_weight_volume
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_order_weight_volume
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_order_weight_volume
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

- Display weight and volume in Purchase Order Line.
- Display total order weight and total order volume in Purchase Order,
tab "Other information".
- Display weight and volume in Purchase Order Line.
- Display total order weight and total order volume in Purchase Order,
tab "Other information".

**Table of contents**

Expand All @@ -42,16 +42,16 @@ Usage

To use this module, you need to:

- Go to Purchase settings.
- Enable checkboxes "Display Order Weight in PO" and/or "Display Order
Volume in PO".
- Go to Products. Update some products with weight and volume values.
- Go to Purchase.
- Create new RFQ. Add products.
- You will see new column with total line items weight and volume.
- You will see order total weight and volume, tab "Other information".
- From this tab, you can also choose whether to display weight and/or
volume info in report.
- Go to Purchase settings.
- Enable checkboxes "Display Order Weight in PO" and/or "Display Order
Volume in PO".
- Go to Products. Update some products with weight and volume values.
- Go to Purchase.
- Create new RFQ. Add products.
- You will see new column with total line items weight and volume.
- You will see order total weight and volume, tab "Other information".
- From this tab, you can also choose whether to display weight and/or
volume info in report.

"Display Order Weight in PO" and "Display Order Volume in PO" can be
enabled/disabled per company.
Expand All @@ -62,7 +62,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_weight_volume%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_weight_volume%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -74,17 +74,18 @@ Authors

* Ilyas
* Ooops404
* Wesolved BV

Contributors
------------

- `Ooops404 <https://www.ooops404.com>`__:
- `Ooops404 <https://www.ooops404.com>`__:

- Ilyas <[email protected]>
- Ilyas <[email protected]>

- `Binhex <https://binhex.cloud/>`__:
- `Binhex <https://binhex.cloud/>`__:

- Deriman Alonso
- Deriman Alonso

Other credits
-------------
Expand Down Expand Up @@ -113,6 +114,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ilyasProgrammer|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_order_weight_volume>`_ project on GitHub.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_weight_volume>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion purchase_order_weight_volume/models/product_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from odoo import models, fields
from odoo import fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"
Expand Down
1 change: 1 addition & 0 deletions purchase_order_weight_volume/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models


class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"

Expand Down
18 changes: 12 additions & 6 deletions purchase_order_weight_volume/report/purchase_report_templates.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<template
id="report_purchasequotation_document"
inherit_id="purchase.report_purchasequotation_document"
Expand All @@ -11,14 +10,18 @@
<div class="col-4">
<table class="table table-sm">
<tr t-if="o.display_total_weight_in_report">
<td><strong>Total Weight</strong></td>
<td>
<strong>Total Weight</strong>
</td>
<td class="text-right">
<span t-field="o.total_weight" />
<span t-field="o.total_weight_uom_id" />
</td>
</tr>
<tr t-if="o.display_total_volume_in_report">
<td><strong>Total Volume</strong></td>
<td>
<strong>Total Volume</strong>
</td>
<td class="text-right">
<span t-field="o.total_volume" />
<span t-field="o.total_volume_uom_id" />
Expand Down Expand Up @@ -68,14 +71,18 @@
<div class="col-4">
<table class="table table-sm">
<tr t-if="o.display_total_weight_in_report">
<td><strong>Total Weight</strong></td>
<td>
<strong>Total Weight</strong>
</td>
<td class="text-right">
<span t-field="o.total_weight" />
<span t-field="o.total_weight_uom_id" />
</td>
</tr>
<tr t-if="o.display_total_volume_in_report">
<td><strong>Total Volume</strong></td>
<td>
<strong>Total Volume</strong>
</td>
<td class="text-right">
<span t-field="o.total_volume" />
<span t-field="o.total_volume_uom_id" />
Expand Down Expand Up @@ -114,5 +121,4 @@
</td>
</xpath>
</template>

</odoo>
7 changes: 4 additions & 3 deletions purchase_order_weight_volume/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Purchase Order Weight and Volume</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5fc57372347771c12c666733240f00957ca2903863e069b18f27f4757ed39114
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_order_weight_volume"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_order_weight_volume"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_weight_volume"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_order_weight_volume"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<ul class="simple">
<li>Display weight and volume in Purchase Order Line.</li>
<li>Display total order weight and total order volume in Purchase Order,
Expand Down Expand Up @@ -412,7 +412,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_weight_volume%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_weight_volume%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -422,6 +422,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Ilyas</li>
<li>Ooops404</li>
<li>Wesolved BV</li>
</ul>
</div>
<div class="section" id="contributors">
Expand Down Expand Up @@ -453,7 +454,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/ilyasProgrammer"><img alt="ilyasProgrammer" src="https://github.com/ilyasProgrammer.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_order_weight_volume">OCA/purchase-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_weight_volume">OCA/purchase-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions purchase_order_weight_volume/views/product_genral_info.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_product_template_form_inherit_pos" model="ir.ui.view">
<field name="name">product.template.form.inherit.pos</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<!-- Add weight and volume after the standard fields -->
<xpath expr="//page[@name='general_information']//group" position="inside">
<xpath expr="//page[@name='general_information']//group" position="inside">
<group>
<field name="weight"/>
<field name="volume"/>
<field name="weight" />
<field name="volume" />
</group>
</xpath>
</field>
Expand Down
36 changes: 14 additions & 22 deletions purchase_order_weight_volume/views/purchase_order_view.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="purchase_order_form_inerit" model="ir.ui.view">
<field name="name">purchase.order.form.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">

<xpath expr="//field[@name='partner_ref']" position="after">
<group>
<field name="total_weight" class="oe_inline"/>]
<field name="total_volume" class="oe_inline"/>
<field name="total_weight" class="oe_inline" />]
<field name="total_volume" class="oe_inline" />
</group>
</xpath>


<xpath
expr="//field[@name='order_line']//list//field[@name='price_unit']"
position="before"
Expand All @@ -27,29 +24,25 @@
position="after"
>
<group class="oe_right">
<label
for="total_weight"
/>
<div
class="text-nowrap"
>
<label for="total_weight" />
<div class="text-nowrap">
<field name="total_weight" class="oe_inline" />
<span style="margin-left:3px;"><field
<span style="margin-left:3px;">
<field
name="total_weight_uom_id"
class="oe_inline pull-right"
/></span>
/>
</span>
</div>
<label
for="total_volume"
/>
<div
class="text-nowrap"
>
<label for="total_volume" />
<div class="text-nowrap">
<field name="total_volume" class="oe_inline" />
<span style="margin-left:3px;"><field
<span style="margin-left:3px;">
<field
name="total_volume_uom_id"
class="oe_inline pull-right"
/></span>
/>
</span>
</div>
</group>
</xpath>
Expand All @@ -66,5 +59,4 @@
</field>
</field>
</record>

</odoo>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="res_config_settings_view_form_purchase_inherit" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit</field>
<field name="model">res.config.settings</field>
Expand All @@ -20,5 +19,4 @@
</xpath>
</field>
</record>

</odoo>

0 comments on commit 4df651c

Please sign in to comment.