diff --git a/modules/analytic_account/tests/scenario_analytic_account.rst b/modules/analytic_account/tests/scenario_analytic_account.rst index 4bb3749166..bfb0b44ec8 100644 --- a/modules/analytic_account/tests/scenario_analytic_account.rst +++ b/modules/analytic_account/tests/scenario_analytic_account.rst @@ -184,12 +184,7 @@ Prepare to balance non-deferral accounts:: >>> period_closing.start_date = fiscalyear.end_date >>> period_closing.end_date = fiscalyear.end_date >>> period_closing.save() - >>> equity, = AccountType.find([('name', '=', 'Equity')]) - >>> account_pl = Account() - >>> account_pl.name = 'P&L' - >>> account_pl.type = equity - >>> account_pl.parent = revenue.parent - >>> account_pl.save() + >>> account_pl, = Account.find([('code', '=', '3.2.1')]) Balance non-deferral accounts:: diff --git a/modules/analytic_account/tests/test_module.py b/modules/analytic_account/tests/test_module.py index b30f6cd9a0..cae7e95b98 100644 --- a/modules/analytic_account/tests/test_module.py +++ b/modules/analytic_account/tests/test_module.py @@ -54,16 +54,20 @@ class AnalyticAccountTestCase(CompanyTestMixin, ModuleTestCase): ]) revenue, = Account.search([ ('type.revenue', '=', True), - ]) + ('closed', '=', False), + ], limit=1) receivable, = Account.search([ ('type.receivable', '=', True), - ]) + ('closed', '=', False), + ], limit=1) expense, = Account.search([ ('type.expense', '=', True), - ]) + ('closed', '=', False), + ], limit=1) payable, = Account.search([ ('type.payable', '=', True), - ]) + ('closed', '=', False), + ], limit=1) first_account_line = { 'account': revenue.id, @@ -171,10 +175,12 @@ class AnalyticAccountTestCase(CompanyTestMixin, ModuleTestCase): ]) expense, = Account.search([ ('type.expense', '=', True), - ]) + ('closed', '=', False), + ], limit=1) payable, = Account.search([ ('type.payable', '=', True), - ]) + ('closed', '=', False), + ], limit=1) move = Move() move.period = period