diff options
| author | Benjamin Frantzen (bfr) <bfr@odoo.com> | 2020-12-03 08:05:16 +0000 |
|---|---|---|
| committer | Benjamin Frantzen (bfr) <bfr@odoo.com> | 2020-12-03 10:05:24 +0000 |
| commit | def8eb4b51a80587f2b4a17da82ceb3abb7f017c (patch) | |
| tree | 076c76c13971d193fb32c9fcea0523ea42b6b39b /addons/account_edi_facturx | |
| parent | be443eabe6198235749b43f6989ea9149c909fcc (diff) | |
[IMP] account_edi: Better OCR management in tests
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#62730
Related: odoo/enterprise#15124
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Diffstat (limited to 'addons/account_edi_facturx')
| -rw-r--r-- | addons/account_edi_facturx/tests/test_facturx.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/account_edi_facturx/tests/test_facturx.py b/addons/account_edi_facturx/tests/test_facturx.py index f36382f121f..b1f556adceb 100644 --- a/addons/account_edi_facturx/tests/test_facturx.py +++ b/addons/account_edi_facturx/tests/test_facturx.py @@ -214,7 +214,7 @@ class TestAccountEdiFacturx(AccountEdiTestCommon): #################################################### def test_invoice_edi_pdf(self): - invoice = self.env['account.move'].with_context(default_move_type='in_invoice').create({}) + invoice = self._create_empty_vendor_bill() invoice_count = len(self.env['account.move'].search([])) self.update_invoice_from_file('account_edi_facturx', 'test_file', 'test_facturx.pdf', invoice) @@ -227,7 +227,7 @@ class TestAccountEdiFacturx(AccountEdiTestCommon): self.assertEqual(len(self.env['account.move'].search([])), invoice_count + 1) def test_invoice_edi_xml(self): - invoice = self.env['account.move'].with_context(default_move_type='in_invoice').create({}) + invoice = self._create_empty_vendor_bill() invoice_count = len(self.env['account.move'].search([])) self.update_invoice_from_file('account_edi_facturx', 'test_file', 'test_facturx.xml', invoice) |
