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

        issue9770
        review300771002
        (grafted from 02524a57bc80acbb6ba829f56d22b096765c83f0)
diffstat:

 sale.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 0676e1d46eae -r f5b2699c0f98 sale.py
--- a/sale.py   Mon May 04 12:27:42 2020 +0200
+++ b/sale.py   Fri Oct 30 00:10:37 2020 +0100
@@ -33,7 +33,8 @@
     @fields.depends('sale', '_parent_sale.party')
     def _get_product_customer_pattern(self):
         return {
-            'party': self.sale.party.id if self.sale.party else -1,
+            'party': (
+                self.sale.party.id if self.sale and self.sale.party else -1),
             }
 
     @fields.depends('product', 'product_customer',

Reply via email to