[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) <bib@odoo.com>
This commit is contained in:
Julien Van Roy
2022-12-06 15:32:55 +01:00
parent 48109c15d3
commit d23bece093
+19 -1
View File
@@ -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,