From b5ef9d86842f1605a3d71a5e6b4033711f0a23cc Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Fri, 25 Mar 2022 13:21:40 +0100 Subject: [PATCH] Fix account_reconcile_model_strict_match_amount tests Tests were broken after introduction of new commit on Odoo. Since account.move.line.ref field was set as readonly, writing a value on it did not set the value on account.move.ref (which it's related to) anymore. cf https://github.com/odoo/odoo/commit/38c13bbef39e3e82a77cfd4a316be94280e3cee5 --- .../test_account_reconcile_model_strict_match_amount.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/account_reconcile_model_strict_match_amount/tests/test_account_reconcile_model_strict_match_amount.py b/account_reconcile_model_strict_match_amount/tests/test_account_reconcile_model_strict_match_amount.py index 71bf7524..5202c1b6 100644 --- a/account_reconcile_model_strict_match_amount/tests/test_account_reconcile_model_strict_match_amount.py +++ b/account_reconcile_model_strict_match_amount/tests/test_account_reconcile_model_strict_match_amount.py @@ -1,10 +1,13 @@ # Copyright 2020 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from odoo.tests import tagged + from odoo.addons.account.tests.test_reconciliation_matching_rules import ( TestReconciliationMatchingRules, ) +@tagged("post_install", "-at_install") class TestAccountReconcileModelStrictMatchAmount(TestReconciliationMatchingRules): @classmethod def setUpClass(cls): @@ -16,7 +19,10 @@ class TestAccountReconcileModelStrictMatchAmount(TestReconciliationMatchingRules cls.invoice_line_s_5 = cls._create_invoice_line( 150, cls.partner_s_3, "out_invoice" ) - cls.invoice_line_s_5.ref = "ABC001XYZ" + # Explicitly set the ref on the account.move after field on the line + # was defined as readonly and value is not written anymore + # cf https://github.com/odoo/odoo/commit/38c13bbef39e3e82a77cfd4a316be94280e3cee5 # noqa + cls.invoice_line_s_5.move_id.ref = "ABC001XYZ" cls.invoice_line_s_6 = cls._create_invoice_line( 300, cls.partner_s_4, "out_invoice" )