diff --git a/mrp_bom_tracking/README.rst b/mrp_bom_tracking/README.rst index 100268a47..04336dac3 100644 --- a/mrp_bom_tracking/README.rst +++ b/mrp_bom_tracking/README.rst @@ -17,19 +17,19 @@ MRP BoM Tracking :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github - :target: https://github.com/OCA/manufacture/tree/16.0/mrp_bom_tracking + :target: https://github.com/OCA/manufacture/tree/17.0/mrp_bom_tracking :alt: OCA/manufacture .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_bom_tracking + :target: https://translation.odoo-community.org/projects/manufacture-17-0/manufacture-17-0-mrp_bom_tracking :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/manufacture&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds track visibility to some fields of mrp boms. Also, -it log notes for any change in the bom lines (components). +This module adds track visibility to some fields of mrp boms. Also, it +log notes for any change in the bom lines (components). **Table of contents** @@ -42,7 +42,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. @@ -50,20 +50,20 @@ Credits ======= Authors -~~~~~~~ +------- * ForgeFlow Contributors -~~~~~~~~~~~~ +------------ -* Miquel Raïch -* Lois Rilo -* Joan Sisquella -* Urvisha Desai +- Miquel Raïch +- Lois Rilo +- Joan Sisquella +- Urvisha Desai Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -75,6 +75,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/manufacture `_ project on GitHub. +This module is part of the `OCA/manufacture `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_bom_tracking/models/mrp_bom.py b/mrp_bom_tracking/models/mrp_bom.py index 58a01fd06..9799c081c 100644 --- a/mrp_bom_tracking/models/mrp_bom.py +++ b/mrp_bom_tracking/models/mrp_bom.py @@ -32,7 +32,7 @@ class MrpBom(models.Model): subtype_id=self.env.ref("mail.mt_note").id, ) bom_line_ids[bom.id] = bom.bom_line_ids - res = super(MrpBom, self).write(values) + res = super().write(values) if "bom_line_ids" in values: for bom in self: new_lines = bom.bom_line_ids - bom_line_ids[bom.id] @@ -51,7 +51,8 @@ class MrpBomLine(models.Model): def write(self, values): if "product_id" in values: for bom in self.mapped("bom_id"): - lines = self.filtered(lambda l: l.bom_id == bom) + # Bind bom variable for the current iteration to the lambda + lines = self.filtered(lambda x, bom=bom: x.bom_id == bom) product_id = values.get("product_id") if product_id: product_id = self.env["product.product"].browse(product_id) @@ -64,7 +65,8 @@ class MrpBomLine(models.Model): ) elif "product_qty" in values or "product_uom_id" in values: for bom in self.mapped("bom_id"): - lines = self.filtered(lambda l: l.bom_id == bom) + # Bind bom variable for the current iteration to the lambda + lines = self.filtered(lambda line, bom=bom: line.bom_id == bom) if lines: product_qty = values.get("product_qty") or lines.product_qty product_uom_id = values.get("product_uom_id") @@ -80,4 +82,4 @@ class MrpBomLine(models.Model): }, subtype_id=self.env.ref("mail.mt_note").id, ) - return super(MrpBomLine, self).write(values) + return super().write(values) diff --git a/mrp_bom_tracking/pyproject.toml b/mrp_bom_tracking/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/mrp_bom_tracking/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mrp_bom_tracking/readme/CONTRIBUTORS.md b/mrp_bom_tracking/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..43f12d468 --- /dev/null +++ b/mrp_bom_tracking/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Miquel Raïch \<\> +- Lois Rilo \<\> +- Joan Sisquella \<\> +- Urvisha Desai \<\> diff --git a/mrp_bom_tracking/readme/CONTRIBUTORS.rst b/mrp_bom_tracking/readme/CONTRIBUTORS.rst deleted file mode 100644 index 5aad6a044..000000000 --- a/mrp_bom_tracking/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,4 +0,0 @@ -* Miquel Raïch -* Lois Rilo -* Joan Sisquella -* Urvisha Desai diff --git a/mrp_bom_tracking/readme/DESCRIPTION.rst b/mrp_bom_tracking/readme/DESCRIPTION.md similarity index 50% rename from mrp_bom_tracking/readme/DESCRIPTION.rst rename to mrp_bom_tracking/readme/DESCRIPTION.md index bee5ea567..b9d6138de 100644 --- a/mrp_bom_tracking/readme/DESCRIPTION.rst +++ b/mrp_bom_tracking/readme/DESCRIPTION.md @@ -1,2 +1,2 @@ -This module adds track visibility to some fields of mrp boms. Also, -it log notes for any change in the bom lines (components). +This module adds track visibility to some fields of mrp boms. Also, it +log notes for any change in the bom lines (components). diff --git a/mrp_bom_tracking/static/description/index.html b/mrp_bom_tracking/static/description/index.html index 15bc0d1ec..f07dac793 100644 --- a/mrp_bom_tracking/static/description/index.html +++ b/mrp_bom_tracking/static/description/index.html @@ -369,9 +369,9 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:ead1d5b33a9ff51d8db34e277785436fa5937da6b7067495f2b3cfb74a415f70 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: LGPL-3 OCA/manufacture Translate me on Weblate Try me on Runboat

-

This module adds track visibility to some fields of mrp boms. Also, -it log notes for any change in the bom lines (components).

+

Production/Stable License: LGPL-3 OCA/manufacture Translate me on Weblate Try me on Runboat

+

This module adds track visibility to some fields of mrp boms. Also, it +log notes for any change in the bom lines (components).

Table of contents

    @@ -389,7 +389,7 @@ it log notes for any change in the bom lines (components).

    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.

@@ -416,7 +416,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

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/manufacture project on GitHub.

+

This module is part of the OCA/manufacture project on GitHub.

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