Do not set unit price or quantity if empty

The unit price or the quantity of the credit note line should not be updated
if the value from the complain invoice line is None as it means we must use
the original one.

issue9497
review290651002
This commit is contained in:
Cédric Krier
2020-08-02 23:56:32 +02:00
parent 8c344ba8c2
commit 74e321f32c
+4 -2
View File
@@ -498,9 +498,11 @@ class Action(ModelSQL, ModelView):
if self.invoice_lines:
invoice_lines = [l.line for l in self.invoice_lines]
line2qty = {l.line: l.quantity
for l in self.invoice_lines}
for l in self.invoice_lines
if l.quantity is not None}
line2price = {l.line: l.unit_price
for l in self.invoice_lines}
for l in self.invoice_lines
if l.unit_price is not None}
else:
invoice_lines = invoice.lines
elif isinstance(self.complaint.origin, Line):