Patch to add party in SaleLine.on_change_product when hasattr

This commit is contained in:
Raimon Esteve 2016-12-13 16:01:59 +01:00
parent 4c059c9007
commit 0a8290a086
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,16 @@
diff -r f71f7fe9949a /trytond/trytond/modules/sale/sale.py
--- a/trytond/trytond/modules/sale/sale.py Tue Dec 13 15:44:22 2016 +0100
+++ b/trytond/trytond/modules/sale/sale.py Tue Dec 13 15:54:20 2016 +0100
@@ -1185,8 +1185,10 @@
party_context = {}
if self.sale and self.sale.party:
party = self.sale.party
- if party.lang:
- party_context['language'] = party.lang.code
+ elif hasattr(self, 'party') and self.party:
+ party = self.party
+ if party and party.lang:
+ party_context['language'] = party.lang.code
# Set taxes before unit_price to have taxes in context of sale price
taxes = []

1
series
View File

@ -62,3 +62,4 @@ issue5865.diff
issue5352.diff
issue5196.diff
issue5052_issue5207.diff
nan-sale-add-party-onchange-product.diff