From 645740bc6115240f1e67c74a51d5421593b8ec33 Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Mon, 16 Feb 2026 03:51:03 +0000 Subject: [PATCH] [IMP] purchase_order_secondary_unit: improve reports to show secondary unit price --- purchase_order_secondary_unit/README.rst | 36 ++++++------- purchase_order_secondary_unit/__manifest__.py | 1 + .../reports/purchase_order_templates.xml | 52 ++++++++++++++++++- .../reports/purchase_quotation_templates.xml | 47 +++++++++++++++-- .../purchase_order_secondary_unit_groups.xml | 9 ++++ .../static/description/index.html | 34 +++++------- 6 files changed, 133 insertions(+), 46 deletions(-) create mode 100644 purchase_order_secondary_unit/security/purchase_order_secondary_unit_groups.xml diff --git a/purchase_order_secondary_unit/README.rst b/purchase_order_secondary_unit/README.rst index 217c79ee82a..cdfd59f6dfa 100644 --- a/purchase_order_secondary_unit/README.rst +++ b/purchase_order_secondary_unit/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ============================= Purchase Order Secondary Unit ============================= @@ -17,7 +13,7 @@ Purchase Order Secondary Unit .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :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 @@ -68,13 +64,13 @@ To use this module you need to: **Vendor Pricelist Integration** -- When adding a vendor to a product's pricelist (via *Purchase tab > - Vendors*), the secondary unit of measure is automatically defaulted - from the product variant's purchase secondary UOM, or from the product - template if not set on the variant. -- When a new vendor pricelist record is created from purchase order - confirmation, the secondary UOM from the purchase order line is - automatically stored in the vendor pricelist entry. +- When adding a vendor to a product's pricelist (via *Purchase tab > + Vendors*), the secondary unit of measure is automatically defaulted + from the product variant's purchase secondary UOM, or from the + product template if not set on the variant. +- When a new vendor pricelist record is created from purchase order + confirmation, the secondary UOM from the purchase order line is + automatically stored in the vendor pricelist entry. Known issues / Roadmap ====================== @@ -105,17 +101,17 @@ Authors Contributors ------------ -- `Tecnativa `__: +- `Tecnativa `__: - - Sergio Teruel - - Ernesto Tejeda + - Sergio Teruel + - Ernesto Tejeda -- Nikul Chaudhary -- Pimolnat Suntian -- Miguel Ángel Gómez -- `Quartile `__: +- Nikul Chaudhary +- Pimolnat Suntian +- Miguel Ángel Gómez +- `Quartile `__: - - Yoshi Tashiro + - Yoshi Tashiro Maintainers ----------- diff --git a/purchase_order_secondary_unit/__manifest__.py b/purchase_order_secondary_unit/__manifest__.py index 02f1fcad354..7368f53ff9d 100644 --- a/purchase_order_secondary_unit/__manifest__.py +++ b/purchase_order_secondary_unit/__manifest__.py @@ -14,6 +14,7 @@ "auto_install": True, "depends": ["purchase", "product_secondary_unit"], "data": [ + "security/purchase_order_secondary_unit_groups.xml", "views/product_views.xml", "views/product_supplierinfo_views.xml", "views/purchase_order_portal_templates.xml", diff --git a/purchase_order_secondary_unit/reports/purchase_order_templates.xml b/purchase_order_secondary_unit/reports/purchase_order_templates.xml index b79d2fc3b3c..01b9b2340ec 100644 --- a/purchase_order_secondary_unit/reports/purchase_order_templates.xml +++ b/purchase_order_secondary_unit/reports/purchase_order_templates.xml @@ -6,16 +6,64 @@ > - + Second Qty - + + + + line.get_secondary_uom_display_mode() != 'secondary' + + + line.get_secondary_uom_display_mode() != 'secondary' + + + + + + + + + + + +
+ + ( + ) + +
+
+ + + line.get_secondary_uom_display_mode() != 'secondary' + + + + diff --git a/purchase_order_secondary_unit/reports/purchase_quotation_templates.xml b/purchase_order_secondary_unit/reports/purchase_quotation_templates.xml index ef64f13d1a1..1dbae6d6855 100644 --- a/purchase_order_secondary_unit/reports/purchase_quotation_templates.xml +++ b/purchase_order_secondary_unit/reports/purchase_quotation_templates.xml @@ -4,18 +4,57 @@ id="report_purchasequotation_document" inherit_id="purchase.report_purchasequotation_document" > - + - + Second Qty - + - + + + + order_line.get_secondary_uom_display_mode() != 'secondary' + + + order_line.get_secondary_uom_display_mode() != 'secondary' + + + + + + + + + + + +
+ + ( + ) + +
+
diff --git a/purchase_order_secondary_unit/security/purchase_order_secondary_unit_groups.xml b/purchase_order_secondary_unit/security/purchase_order_secondary_unit_groups.xml new file mode 100644 index 00000000000..3467b8cd48f --- /dev/null +++ b/purchase_order_secondary_unit/security/purchase_order_secondary_unit_groups.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/purchase_order_secondary_unit/static/description/index.html b/purchase_order_secondary_unit/static/description/index.html index df304240986..8f389aaa713 100644 --- a/purchase_order_secondary_unit/static/description/index.html +++ b/purchase_order_secondary_unit/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Purchase Order Secondary Unit -
+
+

Purchase Order Secondary Unit

- - -Odoo Community Association - -
-

Purchase Order Secondary Unit

-

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runboat

This module extends the functionality of purchase orders to allow buy products in secondary unit of distinct category.

Users can enter quantities and prices in secondary units on purchase @@ -398,13 +393,13 @@

Purchase Order Secondary Unit

-

Configuration

+

Configuration

For configuration of displaying secondary unit information in purchase reports and the Purchase Order portal, see the guidelines provided in product_secondary_unit.

-

Usage

+

Usage

To use this module you need to:

  1. Go to a Product > General Information tab.
  2. @@ -418,22 +413,22 @@

    Usage

    • When adding a vendor to a product’s pricelist (via Purchase tab > Vendors), the secondary unit of measure is automatically defaulted -from the product variant’s purchase secondary UOM, or from the product -template if not set on the variant.
    • +from the product variant’s purchase secondary UOM, or from the +product template if not set on the variant.
    • When a new vendor pricelist record is created from purchase order confirmation, the secondary UOM from the purchase order line is automatically stored in the vendor pricelist entry.
-

Known issues / Roadmap

+

Known issues / Roadmap

Updating existing vendor pricelist records from purchase order confirmation does not currently support secondary UOM or secondary UOM pricing. This is not included in the current scope and may be considered in future improvements.

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub 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 @@ -441,15 +436,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -479,6 +474,5 @@

Maintainers

-