[MIG] account_financial_report: Migration to 18.0
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
import re
|
||||
|
||||
from odoo.tests import tagged
|
||||
|
||||
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
|
||||
@@ -11,8 +13,8 @@ from odoo.addons.account.tests.common import AccountTestInvoicingCommon
|
||||
@tagged("post_install", "-at_install")
|
||||
class TestTrialBalanceReport(AccountTestInvoicingCommon):
|
||||
@classmethod
|
||||
def setUpClass(cls, chart_template_ref=None):
|
||||
super().setUpClass(chart_template_ref=chart_template_ref)
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(
|
||||
context=dict(
|
||||
cls.env.context,
|
||||
@@ -69,11 +71,11 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
|
||||
"account_type": "income_other",
|
||||
},
|
||||
)
|
||||
cls.account301 = cls._create_account_account(
|
||||
cls.account201 = cls._create_account_account(
|
||||
cls,
|
||||
{
|
||||
"code": "301",
|
||||
"name": "Account 301",
|
||||
"code": "201",
|
||||
"name": "Account 201",
|
||||
"group_id": cls.group2.id,
|
||||
"account_type": "income_other",
|
||||
},
|
||||
@@ -167,7 +169,7 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
|
||||
"debit": receivable_credit,
|
||||
"credit": receivable_debit,
|
||||
"partner_id": partner.id,
|
||||
"account_id": self.account301.id,
|
||||
"account_id": self.account201.id,
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -686,8 +688,13 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
|
||||
self.assertEqual(total_debit, total_credit)
|
||||
|
||||
def test_05_all_accounts_loaded(self):
|
||||
# Tests if all accounts are loaded when the account_code_ fields changed
|
||||
all_accounts = self.env["account.account"].search([], order="code")
|
||||
# Tests if all accounts which code is number are loaded
|
||||
# when the account_code_ fields changed
|
||||
all_accounts = (
|
||||
self.env["account.account"]
|
||||
.search([], order="code")
|
||||
.filtered(lambda acc: re.fullmatch(r"[0-9]+(\.[0-9]+)?", acc.code))
|
||||
)
|
||||
company = self.env.user.company_id
|
||||
trial_balance = self.env["trial.balance.report.wizard"].create(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user