diff --git a/l10n_it_withholding_tax/__manifest__.py b/l10n_it_withholding_tax/__manifest__.py index dcf764523006..1fd6b4b978f8 100644 --- a/l10n_it_withholding_tax/__manifest__.py +++ b/l10n_it_withholding_tax/__manifest__.py @@ -4,11 +4,11 @@ { 'name': 'Italian Withholding Tax', - 'version': '10.0.1.0.1', + 'version': '10.0.1.0.2', 'category': 'Account', 'author': 'Openforce, Odoo Italia Network, ' 'Odoo Community Association (OCA)', - 'website': 'https://odoo-community.org/', + 'website': 'https://www.odoo-italia.net/', 'license': 'AGPL-3', "depends": ['account'], "data": [ diff --git a/l10n_it_withholding_tax/models/account.py b/l10n_it_withholding_tax/models/account.py index 46cfc26a6396..f569e1407cdc 100644 --- a/l10n_it_withholding_tax/models/account.py +++ b/l10n_it_withholding_tax/models/account.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # Copyright 2015 Alessandro Camilli () +# Copyright 2018 Lorenzo Battistini - Agile Business Group # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -29,7 +30,11 @@ def create(self, vals): break # Limit value of reconciliation if invoice and invoice.amount_net_pay: - if vals.get('amount') > 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 + amount = vals.get('amount_currency') or vals.get('amount') + if amount > invoice.amount_net_pay: vals.update({'amount': invoice.amount_net_pay}) # Create reconciliation