Do not apply negative unit price after promotion

We must just set a unit price of 0.

issue10903
review377421002
(grafted from 0f2befb01e316a15a38ccd4edfbc33671c35cee0)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2021-10-30 02:07:55 +02:00
1 parent 4eea737ba8
commit 45ae9317d8
1 file changed
+2
+2
View File
@@ -298,6 +298,8 @@ class Promotion(
continue
context = self.get_context_formula(line)
new_price = self.get_unit_price(**context)
if new_price < 0:
new_price = Decimal(0)
if line.unit_price >= new_price:
line.unit_price = round_price(new_price)
line.promotion = self