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 4e514fd57a
commit 0115b4d72b
2 changed files with 14 additions and 0 deletions

1
series
View File

@ -10,6 +10,7 @@ issue8834.diff # [account_payment_clearing] Party required when mark a payment s
issue3932.diff # [account] rule account move and account move line by company
issue8469.diff # [account] Wrong domain in action move line receivable
issue5057.diff # [account] Cannot change the date of a move after creating move lines
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)