LaOsaCoop/Odoo16#66 product_sale_price_from_pricelist: fix discounts computation

This commit is contained in:
Luis 2025-08-02 09:33:39 +02:00
parent b89ca1e5d8
commit c17ceb75a3

View file

@ -31,7 +31,7 @@ class StockMove(models.Model):
elif move.product_id.last_purchase_price_compute_type == "with_discount": elif move.product_id.last_purchase_price_compute_type == "with_discount":
price_updated = float_round( price_updated = float_round(
move.purchase_line_id.price_unit move.purchase_line_id.price_unit
* (1 - move.purchase_line_id.discount / 100), * (1 - move.purchase_line_id.discount1 / 100),
precision_digits=2, precision_digits=2,
) )
elif ( elif (
@ -39,7 +39,7 @@ class StockMove(models.Model):
): ):
price_updated = float_round( price_updated = float_round(
move.purchase_line_id.price_unit move.purchase_line_id.price_unit
* (1 - move.purchase_line_id.discount / 100) * (1 - move.purchase_line_id.discount1 / 100)
* (1 - move.purchase_line_id.discount2 / 100), * (1 - move.purchase_line_id.discount2 / 100),
precision_digits=2, precision_digits=2,
) )