changeset 807480e40f50 in modules/purchase:default
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=807480e40f50
description:
        Test purchase/sale is filled before using it

        issue9770
        review300771002
diffstat:

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

diffs (14 lines):

diff -r 3fb39d608ef9 -r 807480e40f50 purchase.py
--- a/purchase.py       Tue Oct 27 21:12:51 2020 +0100
+++ b/purchase.py       Fri Oct 30 00:10:37 2020 +0100
@@ -1244,7 +1244,9 @@
     @fields.depends('purchase', 'company', '_parent_purchase.party',)
     def _get_product_supplier_pattern(self):
         return {
-            'party': self.purchase.party.id if self.purchase.party else -1,
+            'party': (
+                self.purchase.party.id
+                if self.purchase and self.purchase.party else -1),
             'company': (self.company.id if self.company else -1),
             }
 

Reply via email to