From d23bece0930e541a6252254a2b1b69f4054b2e12 Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Mon, 5 Dec 2022 13:17:06 +0000 Subject: [PATCH] [FIX] l10n_fr_fec: make tests independent from tax template Currently, changing the french default_tax_sale's name or account will make the `test_generate_fec_sanitize_pieceref` fail (for instance: with task-3087037). Make the l10n_fr_fec test independent from any account.tax.template change by creating a new tax in the setup of this test. closes odoo/odoo#107319 X-original-commit: 5128c8dfe75aa943a47e939776804dd878c0e378 Signed-off-by: Brice Bartoletti (bib) --- addons/l10n_fr_fec/tests/test_wizard.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/l10n_fr_fec/tests/test_wizard.py b/addons/l10n_fr_fec/tests/test_wizard.py index e7ddb71a1fd..24ee21f0069 100644 --- a/addons/l10n_fr_fec/tests/test_wizard.py +++ b/addons/l10n_fr_fec/tests/test_wizard.py @@ -7,7 +7,7 @@ from freezegun import freeze_time from odoo.addons.account.tests.common import AccountTestInvoicingCommon from odoo.tests import tagged -from odoo import fields +from odoo import fields, Command @freeze_time('2021-05-02') @@ -23,6 +23,24 @@ class TestAccountFrFec(AccountTestInvoicingCommon): lines_data = [(1437.12, 'Hello\tDarkness'), (1676.64, 'my\rold\nfriend'), (3353.28, '\t\t\r')] today = fields.Date.today().strftime('%Y-%m-%d') + + cls.tax_sale_a = cls.env['account.tax'].create({ + 'name': "TVA 20,0%", + 'amount_type': 'percent', + 'type_tax_use': 'sale', + 'amount': 20, + 'invoice_repartition_line_ids': [ + Command.create({ + 'repartition_type': 'base', + }), + Command.create({ + 'repartition_type': 'tax', + 'factor': 100, + 'account_id': cls.env['account.account'].search([('code', '=', "445710")], limit=1).id, + }) + ] + }) + cls.invoice_a = cls.env['account.move'].create({ 'move_type': 'out_invoice', 'partner_id': cls.partner_a.id,