Skip to content

Commit

Permalink
FIX l10n_it_withholding_tax: don't intervene when not our scope (OCA#485
Browse files Browse the repository at this point in the history
)
  • Loading branch information
eLBati committed Nov 8, 2018
1 parent 8be1ef4 commit 488c8b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
'name': 'Italian Withholding Tax',
'version': '10.0.1.2.1',
'version': '10.0.1.2.2',
'category': 'Account',
'author': 'Openforce, Odoo Italia Network, '
'Odoo Community Association (OCA)',
Expand Down
4 changes: 2 additions & 2 deletions l10n_it_withholding_tax/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def create(self, vals):
if invoice:
break
# Limit value of reconciliation
if invoice and invoice.amount_net_pay:
if invoice and invoice.withholding_tax and invoice.amount_net_pay:
# We must consider amount in foreign currency, if present
# Note that this is always executed, for every reconciliation.
# Thus, we must not chnage amount when not in withholding tax case
# Thus, we must not change amount when not in withholding tax case
amount = vals.get('amount_currency') or vals.get('amount')
if amount > invoice.amount_net_pay:
vals.update({'amount': invoice.amount_net_pay})
Expand Down

0 comments on commit 488c8b1

Please sign in to comment.