[IMP] mrp_bom_tracking: pre-commit auto fixes

This commit is contained in:
Andreu Orensanz
2024-03-08 08:56:12 +01:00
parent db0fadc5b3
commit 373047d24e
7 changed files with 34 additions and 29 deletions

View File

@@ -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 <https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20mrp_bom_tracking%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_bom_tracking%0Aversion:%2017.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.
@@ -50,20 +50,20 @@ Credits
=======
Authors
~~~~~~~
-------
* ForgeFlow
Contributors
~~~~~~~~~~~~
------------
* Miquel Raïch <miquel.raich@forgeflow.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Joan Sisquella <joan.sisquella@forgeflow.com>
* Urvisha Desai <udesaia@opensourceintegrators.com>
- Miquel Raïch <miquel.raich@forgeflow.com>
- Lois Rilo <lois.rilo@forgeflow.com>
- Joan Sisquella <joan.sisquella@forgeflow.com>
- Urvisha Desai <udesaia@opensourceintegrators.com>
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 <https://github.com/OCA/manufacture/tree/16.0/mrp_bom_tracking>`_ project on GitHub.
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/17.0/mrp_bom_tracking>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -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)

View File

@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -0,0 +1,4 @@
- Miquel Raïch \<<miquel.raich@forgeflow.com>\>
- Lois Rilo \<<lois.rilo@forgeflow.com>\>
- Joan Sisquella \<<joan.sisquella@forgeflow.com>\>
- Urvisha Desai \<<udesaia@opensourceintegrators.com>\>

View File

@@ -1,4 +0,0 @@
* Miquel Raïch <miquel.raich@forgeflow.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Joan Sisquella <joan.sisquella@forgeflow.com>
* Urvisha Desai <udesaia@opensourceintegrators.com>

View File

@@ -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).

View File

@@ -369,9 +369,9 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ead1d5b33a9ff51d8db34e277785436fa5937da6b7067495f2b3cfb74a415f70
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/manufacture/tree/16.0/mrp_bom_tracking"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_bom_tracking"><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/manufacture&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds track visibility to some fields of mrp boms. Also,
it log notes for any change in the bom lines (components).</p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/manufacture/tree/17.0/mrp_bom_tracking"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-17-0/manufacture-17-0-mrp_bom_tracking"><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/manufacture&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>This module adds track visibility to some fields of mrp boms. Also, it
log notes for any change in the bom lines (components).</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@@ -389,7 +389,7 @@ it log notes for any change in the bom lines (components).</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20mrp_bom_tracking%0Aversion:%2016.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/manufacture/issues/new?body=module:%20mrp_bom_tracking%0Aversion:%2017.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">
@@ -416,7 +416,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/16.0/mrp_bom_tracking">OCA/manufacture</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/17.0/mrp_bom_tracking">OCA/manufacture</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>