changeset 085a59108214 in modules/purchase:default
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=085a59108214
description:
        Only update actual quantity when it has changed

        issue9541
        review294321002
diffstat:

 purchase.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r fe2e17fef3cc -r 085a59108214 purchase.py
--- a/purchase.py       Thu Sep 24 22:49:09 2020 +0200
+++ b/purchase.py       Sun Oct 04 23:54:46 2020 +0200
@@ -1645,7 +1645,9 @@
                     or invoice_line.invoice.state != 'cancelled'):
                 invoiced_quantity += Uom.compute_qty(
                     invoice_line.unit, invoice_line.quantity, self.unit)
-        self.actual_quantity = max(moved_quantity, invoiced_quantity, key=abs)
+        actual_quantity = max(moved_quantity, invoiced_quantity, key=abs)
+        if self.actual_quantity != actual_quantity:
+            self.actual_quantity = actual_quantity
 
     def get_rec_name(self, name):
         pool = Pool()

Reply via email to