Skip to content

Commit

Permalink
[14.0][IMP] product_pricelist_last_purchase_price: If find more than …
Browse files Browse the repository at this point in the history
…one product supplierinfo, take the one with the lowest sequence.
  • Loading branch information
alfredoavanzosc committed Dec 5, 2024
1 parent 44f6dca commit 3d89b4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions product_pricelist_last_purchase_price/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def _find_seller_to_update_suppliernfo_to_product(self, line, partner):
lambda x: x.name == partner
and (x.price != line.price_unit or x.discount != line.discount)
)
if len(seller) > 1:
seller = min(seller, key=lambda x: x.sequence)
if seller and seller.not_update_price_from_invoice:
seller = False
return seller

0 comments on commit 3d89b4f

Please sign in to comment.