Skip to content

Commit

Permalink
[FIX] sale_product_pack: _get_update_prices_lines refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jue-adhoc committed Nov 27, 2024
1 parent 34a63d4 commit f95a579
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions sale_product_pack/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ def write(self, vals):

def _get_update_prices_lines(self):
res = super()._get_update_prices_lines()
result = self.order_line.browse()
index = 0
while index < len(res):
line = res[index]
result |= line
index += 1
if line.product_id.pack_ok and line.pack_type == "detailed":
index += len(line.product_id.pack_line_ids)
return result
return res.filtered(
lambda line: not line.pack_parent_line_id
or line.pack_parent_line_id.pack_component_price == "detailed"
)

0 comments on commit f95a579

Please sign in to comment.