Skip to content

Commit

Permalink
FIX l10n_it_fatturapa_in: log inconsistency when multiple exemption t…
Browse files Browse the repository at this point in the history
…axes are found, so that user is informed

IMP module name
  • Loading branch information
eLBati authored and TheMule71 committed Jun 9, 2021
1 parent e18c2fe commit 96c8e52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_in/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 8 additions & 1 deletion l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down

0 comments on commit 96c8e52

Please sign in to comment.