changeset f64deebfb13e in modules/sale_complaint:5.6
details: 
https://hg.tryton.org/modules/sale_complaint?cmd=changeset;node=f64deebfb13e
description:
        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
        (grafted from f259cba8516cbc2a24fac697ae12323a4a014d3c)
diffstat:

 complaint.py |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r ea7dec021766 -r f64deebfb13e complaint.py
--- a/complaint.py      Mon May 04 12:26:04 2020 +0200
+++ b/complaint.py      Sun Aug 02 23:56:32 2020 +0200
@@ -498,9 +498,11 @@
                 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):

Reply via email to