Skip to content

Commit

Permalink
lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
petrus-v committed Jan 18, 2024
1 parent 709d2c8 commit 8620279
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion product_pack/models/product_pricelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _compute_price_rule(self, products_qty_partner, date=False, uom_id=False):
products_qty_partner_super = [
(s[0], s[1], s[2])
for s in products_qty_partner
if not s[0] in s[0].split_pack_products()[0]
if s[0] not in s[0].split_pack_products()[0]
]
res = super()._compute_price_rule(
products_qty_partner_super, date=date, uom_id=uom_id
Expand Down
2 changes: 1 addition & 1 deletion product_pack/tests/test_product_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_get_pack_line_price(self):
self.assertEqual(
30.0,
self.cpu_detailed.pack_line_ids.filtered(
lambda l: l.product_id == component.product_id
lambda pack_line: pack_line.product_id == component.product_id
).get_price(),
)

Expand Down
2 changes: 1 addition & 1 deletion sale_product_pack/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def copy(self, default=None):
sale_copy = super().copy(default)
# we unlink pack lines that should not be copied
pack_copied_lines = sale_copy.order_line.filtered(
lambda l: l.pack_parent_line_id.order_id == self
lambda order_line: order_line.pack_parent_line_id.order_id == self
)
pack_copied_lines.unlink()
return sale_copy
Expand Down
8 changes: 6 additions & 2 deletions sale_product_pack/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class SaleOrderLine(models.Model):

do_no_expand_pack_lines = fields.Boolean(
compute="_compute_do_no_expand_pack_lines",
help="This is a technical field in order to check if pack lines has to be expanded",
help=(
"This is a technical field in order to check if pack lines has "
"to be expanded"
),
)

@api.depends_context("update_prices", "update_pricelist")
Expand All @@ -57,7 +60,8 @@ def expand_pack_line(self, write=False):
if write:
existing_subline = first(
self.pack_child_line_ids.filtered(
lambda child: child.product_id == subline.product_id
lambda child, pack_line=subline: child.product_id
== pack_line.product_id
)
)
# if subline already exists we update, if not we create
Expand Down

0 comments on commit 8620279

Please sign in to comment.