When importing an xml in tests, if the import fails, the OCR will try to parse the file, which will cause an user access error. This polutes the logs and makes it hard to debug the code/test. With this commit a helper is added to create and invoice with OCR deactivated to be used to import the file. closes odoo/odoo#62817 Related: odoo/enterprise#15134 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com> Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
21 lines
910 B
Python
21 lines
910 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
|
|
|
|
|
|
class TestUBL(AccountEdiTestCommon):
|
|
@classmethod
|
|
def setUpClass(cls, chart_template_ref='l10n_be.l10nbe_chart_template', edi_format_ref='l10n_be_edi.edi_efff_1'):
|
|
super().setUpClass(chart_template_ref=chart_template_ref, edi_format_ref=edi_format_ref)
|
|
|
|
cls.partner_a.vat = 'BE0123456789'
|
|
|
|
def test_invoice_edi_xml(self):
|
|
invoice = self._create_empty_vendor_bill()
|
|
invoice_count = len(self.env['account.move'].search([]))
|
|
self.update_invoice_from_file('l10n_be_edi', 'test_xml_file', 'efff_test.xml', invoice)
|
|
|
|
self.assertEqual(len(self.env['account.move'].search([])), invoice_count)
|
|
self.assertEqual(invoice.amount_total, 666.50)
|
|
self.assertEqual(invoice.amount_tax, 115.67)
|
|
self.assertEqual(invoice.partner_id, self.partner_a)
|