From 96c8e528289aeba37fe3a7601b8f86d6e8293913 Mon Sep 17 00:00:00 2001 From: eLBati Date: Tue, 26 Mar 2019 17:35:40 +0100 Subject: [PATCH] FIX l10n_it_fatturapa_in: log inconsistency when multiple exemption taxes are found, so that user is informed IMP module name --- l10n_it_fatturapa_in/__manifest__.py | 2 +- l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/l10n_it_fatturapa_in/__manifest__.py b/l10n_it_fatturapa_in/__manifest__.py index d5d34e068813..c549d91ef4cd 100644 --- a/l10n_it_fatturapa_in/__manifest__.py +++ b/l10n_it_fatturapa_in/__manifest__.py @@ -5,7 +5,7 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). { - 'name': 'Italian Localization - Fattura elettronica - Ricezione', + 'name': 'ITA - Fattura elettronica - Ricezione', 'version': '12.0.1.2.1', "development_status": "Beta", 'category': 'Localization/Italy', diff --git a/l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py b/l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py index bd3579f87897..da09d1c5be5f 100644 --- a/l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py +++ b/l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py @@ -286,12 +286,19 @@ def _prepare_generic_line_data(self, line): ('type_tax_use', '=', 'purchase'), ('kind_id.code', '=', line.Natura), ('amount', '=', 0.0), - ], order='sequence', limit=1) + ], order='sequence') if not account_taxes: self.log_inconsistency( _('No tax with percentage ' '%s and nature %s found. Please configure this tax.') % (line.AliquotaIVA, line.Natura)) + if len(account_taxes) > 1: + self.log_inconsistency( + _('Too many taxes with percentage ' + '%s and nature %s found. Tax %s with lower priority has ' + 'been set on invoice lines.') + % (line.AliquotaIVA, line.Natura, + account_taxes[0].description)) else: account_taxes = account_tax_model.search( [