trytond-patches/issue6836.diff

42 lines
1.7 KiB
Diff

diff -r 34d86dcfd76a trytond/trytond/modules/sale/sale.py
--- a/trytond/trytond/modules/sale/sale.py Thu Apr 12 14:25:55 2018 +0200
+++ b/trytond/trytond/modules/sale/sale.py Thu Apr 12 14:32:33 2018 +0200
@@ -1229,10 +1229,6 @@
def on_change_unit(self):
self.on_change_quantity()
- @fields.depends(methods=['quantity'])
- def on_change_taxes(self):
- self.on_change_quantity()
-
@fields.depends('type', 'quantity', 'unit_price', 'unit', 'sale',
'_parent_sale.currency')
def on_change_with_amount(self):
diff -r 7af5346a9832 trytond/trytond/modules/purchase/purchase.py
--- a/trytond/trytond/modules/purchase/purchase.py Sat Mar 24 13:47:39 2018 +0100
+++ b/trytond/trytond/modules/purchase/purchase.py Thu Apr 12 14:41:55 2018 +0200
@@ -1133,10 +1133,6 @@
def on_change_unit(self):
self.on_change_quantity()
- @fields.depends(methods=['quantity'])
- def on_change_taxes(self):
- self.on_change_quantity()
-
@fields.depends('type', 'quantity', 'unit_price', 'unit', 'purchase',
'_parent_purchase.currency')
def on_change_with_amount(self):
diff -r 38b54301d632 trytond/trytond/modules/sale_price_list/sale.py
--- a/trytond/trytond/modules/sale_price_list/sale.py Mon May 02 17:35:25 2016 +0200
+++ b/trytond/trytond/modules/sale_price_list/sale.py Tue Oct 17 09:59:30 2017 +0200
@@ -51,3 +51,9 @@
if self.sale and getattr(self.sale, 'price_list', None):
context['price_list'] = self.sale.price_list.id
return context
+
+ @fields.depends(methods=['quantity'])
+ def on_change_taxes(self):
+ if self.sale.price_list and self.sale.price_list.tax_included:
+ self.on_change_quantity()
+