Skip to content

Commit

Permalink
[FIX] l10n_it_edi, l10n_it_stock_ddt: fix errors when trying to gener…
Browse files Browse the repository at this point in the history
…ate the edi without l10n_it_edi_sdicoop_installed

closes odoo#72001

X-original-commit: ac423fd
Signed-off-by: William André (wan) <wan@odoo.com>
  • Loading branch information
bfr-o authored and william-andre committed Jun 11, 2021
1 parent 78ba08f commit 41366b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/l10n_it_edi/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def _check_before_xml_exporting(self):
# DEPRECATED use AccountEdiFormat._l10n_it_edi_check_invoice_configuration instead
errors = self.env['account.edi.format']._l10n_it_edi_check_invoice_configuration(self)
if errors:
raise self.env['account.edi.format']._format_error_message(_("Invalid configuration:"), errors)
raise UserError(self.env['account.edi.format']._format_error_message(_("Invalid configuration:"), errors))

def invoice_generate_xml(self):
self.ensure_one()
report_name = self.env['account_edi_format']._l10n_it_edi_generate_electronic_invoice_filename(self)
report_name = self.env['account.edi.format']._l10n_it_edi_generate_electronic_invoice_filename(self)

data = b"<?xml version='1.0' encoding='UTF-8'?>" + self._export_as_xml()
description = _('Italian invoice: %s', self.move_type)
Expand Down
4 changes: 4 additions & 0 deletions addons/l10n_it_stock_ddt/tests/test_ddt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def setUpClass(cls, chart_template_ref='l10n_it.l10n_it_chart_template_generic')
'zip': '26100',
'city': 'Cremona',
})
cls.env['res.partner.bank'].create({
'acc_number': 'IT60X0542811101000000123456',
'partner_id': cls.company_data['company'].partner_id.id,
})
cls.partner_a.write({
'street': 'Piazza Guglielmo Marconi 5',
'zip': '26100',
Expand Down

0 comments on commit 41366b8

Please sign in to comment.