changeset a53a346bf66d in modules/purchase_secondary_unit:default
details: 
https://hg.tryton.org/modules/purchase_secondary_unit?cmd=changeset&node=a53a346bf66d
description:
        Test if there is a secondary unit before comparing categories

        issue11287
        review370931002
diffstat:

 purchase.py |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r da53cf2e9cb4 -r a53a346bf66d purchase.py
--- a/purchase.py       Thu Feb 03 23:13:27 2022 +0100
+++ b/purchase.py       Fri Mar 18 13:01:13 2022 +0100
@@ -198,6 +198,7 @@
         product = self.product
         if (product
                 and self.unit
+                and product.purchase_secondary_uom
                 and (self.unit.category
                     == product.purchase_secondary_uom.category)):
             unit = product.purchase_uom
@@ -213,6 +214,7 @@
         if (product
                 and self.unit
                 and request_unit
+                and product.purchase_secondary_uom
                 and (self.unit.category
                     == product.purchase_secondary_uom.category)
                 and request_unit.category == product.purchase_uom.category):

Reply via email to