Add new diff tax_update_unit_price to control the update_unit_price field from parenttoo

This commit is contained in:
Bernat Brunet 2020-01-20 16:21:50 +01:00
parent fe7ad3a5c2
commit 11e1f37e1e
2 changed files with 14 additions and 0 deletions

1
series
View File

@ -6,6 +6,7 @@ account_payment_view.diff # [account_payment]
issue8852.diff # [country] Adapt import_zip script to use the right subdivision type per country
issue3932.diff # [account] rule account move and account move line by company
tax_update_unit_price.diff # [account] Add the update_unit_price control on parent tax
account_asset.diff # [account_asset] check if exist asset_lines

View File

@ -0,0 +1,13 @@
diff --git a/tax.py b/tax.py
--- a/trytond/trytond/modules/account/tax.py Thu Gen 20 10:25:13 2020 +0200
+++ b/trytond/trytond/modules/account/tax.py Thu Gen 20 10:32:48 2020 +0200
@@ -906,7 +906,8 @@ class Tax(sequence_ordered(), ModelSQL, ModelView, DeactivableMixin):
if len(tax.childs):
values.extend(
cls._unit_compute(tax.childs, price_unit, date))
- if tax.update_unit_price:
+ if (tax.update_unit_price or
+ tax.parent and tax.parent.update_unit_price):
for value in values:
unit_price_variation += value['amount']
res.extend(values)