Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] autoupdate flake8 #1415

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ repos:
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.1.1
hooks:
- id: flake8
name: flake8
Expand Down
6 changes: 4 additions & 2 deletions mrp_bom_location/report/bom_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def _get_bom_data(
line_ids = self.env["mrp.bom.line"].search([("bom_id", "=", bom.id)])
for line in res["components"]:
bom_line = line_ids.filtered(
lambda l: l.location_id and l.product_id.id == line["product_id"]
lambda bom_line: bom_line.location_id
and bom_line.product_id.id == line["product_id"]
)
line["location_id"] = bom_line.location_id or ""
if parent_bom and parent_bom.location_id.complete_name:
Expand Down Expand Up @@ -81,7 +82,8 @@ def _get_pdf_line(
line_ids = self.env["mrp.bom.line"].search([("bom_id", "=", bom_id)])
for line in res["lines"]:
line_id = line_ids.filtered(
lambda l: l.location_id and l.product_id.display_name == line["name"]
lambda bom_line: bom_line.location_id
and bom_line.product_id.display_name == line["name"]
)
line["location_name"] = line_id.location_id.complete_name or ""
return res
4 changes: 2 additions & 2 deletions mrp_bom_tracking/models/mrp_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ 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)
lines = self.filtered(lambda line: line.bom_id == bom)
product_id = values.get("product_id")
if product_id:
product_id = self.env["product.product"].browse(product_id)
Expand All @@ -64,7 +64,7 @@ def write(self, values):
)
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)
lines = self.filtered(lambda line: line.bom_id == bom)
if lines:
product_qty = values.get("product_qty") or lines.product_qty
product_uom_id = values.get("product_uom_id")
Expand Down
10 changes: 6 additions & 4 deletions mrp_lot_number_propagation/models/mrp_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ def _compute_propagated_lot_producing(self):
order.propagated_lot_producing = False
move_with_lot = order._get_propagating_component_move()
line_with_sn = move_with_lot.move_line_ids.filtered(
lambda l: (
l.lot_id
and l.product_id.tracking == "serial"
lambda stock_move_line: (
stock_move_line.lot_id
and stock_move_line.product_id.tracking == "serial"
and tools.float_compare(
l.qty_done, 1, precision_rounding=l.product_uom_id.rounding
stock_move_line.qty_done,
1,
precision_rounding=stock_move_line.product_uom_id.rounding,
)
== 0
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def assign_quants(self):
"Product Unit of Measure"
)
lots_to_consume = self.quants_lines.filtered(
lambda l: l.to_consume_now
lambda quant_line: quant_line.to_consume_now
).mapped("lot_id")
for ml in move.move_line_ids:
if ml.lot_id in lots_to_consume:
Expand Down
Loading