From b248adeaa4b4841bfbcd8bee3ba22dddc6d7f9f8 Mon Sep 17 00:00:00 2001 From: "Paolo (pgi)" Date: Mon, 12 Jul 2021 09:50:24 +0000 Subject: [PATCH] [FIX] account: Fixing AccountTestInvoicingCommon Default parameters should be None instead of empty dict {} or list [] because such types are mutable. See: https://docs.python-guide.org/writing/gotchas/ Part-of: odoo/odoo#77295 --- addons/account/tests/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/tests/common.py b/addons/account/tests/common.py index 9763b2b9e86..6aeb92bf0b5 100644 --- a/addons/account/tests/common.py +++ b/addons/account/tests/common.py @@ -260,7 +260,8 @@ class AccountTestInvoicingCommon(TransactionCase): } @classmethod - def setup_multi_currency_data(cls, default_values={}, rate2016=3.0, rate2017=2.0): + def setup_multi_currency_data(cls, default_values=None, rate2016=3.0, rate2017=2.0): + default_values = default_values or {} foreign_currency = cls.env['res.currency'].create({ 'name': 'Gold Coin', 'symbol': '☺', @@ -672,7 +673,8 @@ class TestAccountReconciliationCommon(AccountTestInvoicingCommon): auto_validate=True ) - def make_payment(self, invoice_record, bank_journal, amount=0.0, amount_currency=0.0, currency_id=None, reconcile_param=[]): + def make_payment(self, invoice_record, bank_journal, amount=0.0, amount_currency=0.0, currency_id=None, reconcile_param=None): + reconcile_param = reconcile_param or [] bank_stmt = self.env['account.bank.statement'].create({ 'journal_id': bank_journal.id, 'date': time.strftime('%Y') + '-07-15',