From 6f4471c5eabbc050bf033b16cf8f2991eb37a4ac Mon Sep 17 00:00:00 2001 From: Martha Rondon Date: Thu, 26 Sep 2024 17:45:43 -0400 Subject: [PATCH] [MIG] purchase_order_secondary_unit: Migration to 17.0 [IMP] purchase_order_secondary_unit: pre-commit auto fixes [IMP] purchase_order_secondary_unit: pre-commit auto fixes [DON'T MERGE] test-requirements.txt [Don't MERGE] Remove dependency --- purchase_order_secondary_unit/README.rst | 44 ++++++++++--------- purchase_order_secondary_unit/__manifest__.py | 2 +- .../models/purchase_order.py | 13 +++--- purchase_order_secondary_unit/pyproject.toml | 3 ++ .../readme/CONTRIBUTORS.md | 6 +++ .../readme/CONTRIBUTORS.rst | 7 --- .../{DESCRIPTION.rst => DESCRIPTION.md} | 4 +- purchase_order_secondary_unit/readme/USAGE.md | 8 ++++ .../readme/USAGE.rst | 7 --- .../static/description/index.html | 24 +++++----- .../views/product_views.xml | 7 ++- .../views/purchase_order_views.xml | 15 ++++--- 12 files changed, 78 insertions(+), 62 deletions(-) create mode 100644 purchase_order_secondary_unit/pyproject.toml create mode 100644 purchase_order_secondary_unit/readme/CONTRIBUTORS.md delete mode 100644 purchase_order_secondary_unit/readme/CONTRIBUTORS.rst rename purchase_order_secondary_unit/readme/{DESCRIPTION.rst => DESCRIPTION.md} (53%) create mode 100644 purchase_order_secondary_unit/readme/USAGE.md delete mode 100644 purchase_order_secondary_unit/readme/USAGE.rst diff --git a/purchase_order_secondary_unit/README.rst b/purchase_order_secondary_unit/README.rst index f14e543f505..0c97dc738bd 100644 --- a/purchase_order_secondary_unit/README.rst +++ b/purchase_order_secondary_unit/README.rst @@ -17,19 +17,19 @@ Purchase Order Secondary Unit :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/15.0/purchase_order_secondary_unit + :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_order_secondary_unit :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-15-0/purchase-workflow-15-0-purchase_order_secondary_unit + :target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_order_secondary_unit :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=15.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module extends the functionality of purchase orders to allow buy products -in secondary unit of distinct category. +This module extends the functionality of purchase orders to allow buy +products in secondary unit of distinct category. **Table of contents** @@ -41,11 +41,12 @@ Usage To use this module you need to: -#. Go to a *Product > General Information tab*. -#. Create any record in "Secondary unit of measure". -#. Set the conversion factor. -#. Go to *Purchase > Quotation > Create*. -#. Change secondary qty and secondary uom in line, and quantity (product_qty) will be changed (according to the conversion factor). +1. Go to a *Product > General Information tab*. +2. Create any record in "Secondary unit of measure". +3. Set the conversion factor. +4. Go to *Purchase > Quotation > Create*. +5. Change secondary qty and secondary uom in line, and quantity + (product_qty) will be changed (according to the conversion factor). Bug Tracker =========== @@ -53,7 +54,7 @@ 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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -61,23 +62,24 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Sergio Teruel - * Ernesto Tejeda -* Nikul Chaudhary -* Pimolnat Suntian -* Miguel Ángel Gómez + - Sergio Teruel + - Ernesto Tejeda + +- Nikul Chaudhary +- Pimolnat Suntian +- Miguel Ángel Gómez Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -89,6 +91,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/purchase-workflow `_ project on GitHub. +This module is part of the `OCA/purchase-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_order_secondary_unit/__manifest__.py b/purchase_order_secondary_unit/__manifest__.py index 2c6fd33b230..53204e164b4 100644 --- a/purchase_order_secondary_unit/__manifest__.py +++ b/purchase_order_secondary_unit/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Purchase Order Secondary Unit", "summary": "Purchase product in a secondary unit", - "version": "15.0.1.3.0", + "version": "17.0.1.0.0", "development_status": "Beta", "category": "Purchase", "website": "https://github.com/OCA/purchase-workflow", diff --git a/purchase_order_secondary_unit/models/purchase_order.py b/purchase_order_secondary_unit/models/purchase_order.py index 867506c82af..ac809d4ef58 100644 --- a/purchase_order_secondary_unit/models/purchase_order.py +++ b/purchase_order_secondary_unit/models/purchase_order.py @@ -12,15 +12,14 @@ class PurchaseOrderLine(models.Model): } _product_uom_field = "uom_po_id" - product_qty = fields.Float( - store=True, readonly=False, compute="_compute_product_qty", copy=True - ) + product_qty = fields.Float(copy=True) - @api.depends("secondary_uom_qty", "secondary_uom_id") + @api.depends("secondary_uom_qty", "secondary_uom_id", "product_packaging_qty") def _compute_product_qty(self): - if hasattr(super(), "_compute_product_qty"): - return super()._compute_product_qty() - return self._compute_helper_target_field_qty() + res = super()._compute_product_qty() + for line in self: + line._compute_helper_target_field_qty() + return res @api.onchange("product_uom") def onchange_product_uom_for_secondary(self): diff --git a/purchase_order_secondary_unit/pyproject.toml b/purchase_order_secondary_unit/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/purchase_order_secondary_unit/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/purchase_order_secondary_unit/readme/CONTRIBUTORS.md b/purchase_order_secondary_unit/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..1d97b2c52aa --- /dev/null +++ b/purchase_order_secondary_unit/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- [Tecnativa](https://www.tecnativa.com): + - Sergio Teruel + - Ernesto Tejeda +- Nikul Chaudhary \<\> +- Pimolnat Suntian \<\> +- Miguel Ángel Gómez \<\> diff --git a/purchase_order_secondary_unit/readme/CONTRIBUTORS.rst b/purchase_order_secondary_unit/readme/CONTRIBUTORS.rst deleted file mode 100644 index 1fac397de2c..00000000000 --- a/purchase_order_secondary_unit/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,7 +0,0 @@ -* `Tecnativa `_: - - * Sergio Teruel - * Ernesto Tejeda -* Nikul Chaudhary -* Pimolnat Suntian -* Miguel Ángel Gómez diff --git a/purchase_order_secondary_unit/readme/DESCRIPTION.rst b/purchase_order_secondary_unit/readme/DESCRIPTION.md similarity index 53% rename from purchase_order_secondary_unit/readme/DESCRIPTION.rst rename to purchase_order_secondary_unit/readme/DESCRIPTION.md index 0d1e023e2d1..f81706f581f 100644 --- a/purchase_order_secondary_unit/readme/DESCRIPTION.rst +++ b/purchase_order_secondary_unit/readme/DESCRIPTION.md @@ -1,2 +1,2 @@ -This module extends the functionality of purchase orders to allow buy products -in secondary unit of distinct category. +This module extends the functionality of purchase orders to allow buy +products in secondary unit of distinct category. diff --git a/purchase_order_secondary_unit/readme/USAGE.md b/purchase_order_secondary_unit/readme/USAGE.md new file mode 100644 index 00000000000..3e7f0e0aed2 --- /dev/null +++ b/purchase_order_secondary_unit/readme/USAGE.md @@ -0,0 +1,8 @@ +To use this module you need to: + +1. Go to a *Product \> General Information tab*. +2. Create any record in "Secondary unit of measure". +3. Set the conversion factor. +4. Go to *Purchase \> Quotation \> Create*. +5. Change secondary qty and secondary uom in line, and quantity + (product_qty) will be changed (according to the conversion factor). diff --git a/purchase_order_secondary_unit/readme/USAGE.rst b/purchase_order_secondary_unit/readme/USAGE.rst deleted file mode 100644 index 7628041d1e7..00000000000 --- a/purchase_order_secondary_unit/readme/USAGE.rst +++ /dev/null @@ -1,7 +0,0 @@ -To use this module you need to: - -#. Go to a *Product > General Information tab*. -#. Create any record in "Secondary unit of measure". -#. Set the conversion factor. -#. Go to *Purchase > Quotation > Create*. -#. Change secondary qty and secondary uom in line, and quantity (product_qty) will be changed (according to the conversion factor). diff --git a/purchase_order_secondary_unit/static/description/index.html b/purchase_order_secondary_unit/static/description/index.html index e5384c760f9..327ed6b2a41 100644 --- a/purchase_order_secondary_unit/static/description/index.html +++ b/purchase_order_secondary_unit/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,9 +369,9 @@

Purchase Order Secondary Unit

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:6fe09534fb81482ee9e3d7e40b8be0ba40897aeb01b621beb055da2b961cf89a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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.

+

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.

Table of contents

    @@ -392,7 +393,8 @@

    Usage

  • Create any record in “Secondary unit of measure”.
  • Set the conversion factor.
  • Go to Purchase > Quotation > Create.
  • -
  • Change secondary qty and secondary uom in line, and quantity (product_qty) will be changed (according to the conversion factor).
  • +
  • Change secondary qty and secondary uom in line, and quantity +(product_qty) will be changed (according to the conversion factor).
@@ -400,7 +402,7 @@

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 -feedback.

+feedback.

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

@@ -427,11 +429,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/purchase-workflow project on GitHub.

+

This module is part of the OCA/purchase-workflow project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/purchase_order_secondary_unit/views/product_views.xml b/purchase_order_secondary_unit/views/product_views.xml index d9f7dd00000..b7d1daee5fd 100644 --- a/purchase_order_secondary_unit/views/product_views.xml +++ b/purchase_order_secondary_unit/views/product_views.xml @@ -6,10 +6,13 @@ Product template Secondary Unit product.template - - + diff --git a/purchase_order_secondary_unit/views/purchase_order_views.xml b/purchase_order_secondary_unit/views/purchase_order_views.xml index fab1138e40e..46b214994d4 100644 --- a/purchase_order_secondary_unit/views/purchase_order_views.xml +++ b/purchase_order_secondary_unit/views/purchase_order_views.xml @@ -6,7 +6,6 @@ Purchase Order Secondary Unit purchase.order -