From 42ba6d2d66f7bccea9960bcaaec05252952cee4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 17 Aug 2023 16:30:28 +0200 Subject: [PATCH] Use absolute quantity to compute sale price Closes #12496 --- modules/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sale/sale.py b/modules/sale/sale.py index b0250121e3..e8632cd800 100644 --- a/modules/sale/sale.py +++ b/modules/sale/sale.py @@ -1523,7 +1523,7 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView): with Transaction().set_context( self._get_context_sale_price()): unit_price = Product.get_sale_price([self.product], - self.quantity or 0)[self.product.id] + abs(self.quantity or 0))[self.product.id] if unit_price is not None: unit_price = round_price(unit_price) return unit_price