diff --git a/addons/account/test/account_cash_statement.yml b/addons/account/test/account_cash_statement.yml deleted file mode 100644 index af78c649dbf..00000000000 --- a/addons/account/test/account_cash_statement.yml +++ /dev/null @@ -1,62 +0,0 @@ -- - TODO: improve this test and add the use of cashbox lines to set the ending balance and use of the confirmation wizard -- - In order to test Cash statement I create a Cash statement and confirm it and check its move created -- - !record {model: account.cash.statement, id: account_cash_statement_1, view: False}: - date: !eval time.strftime('%Y-%m-%d') - name: / - user_id: base.user_root - balance_start: 120.0 - balance_end: 120.0 -- - I check that Initially cash statement is in the "Draft" state -- - !assert {model: account.cash.statement, id: account_cash_statement_1}: - - state == 'draft' - -- - I clicked on Open CashBox button to open the cashbox -- - !python {model: account.cash.statement, id: account_cash_statement_1}: | - context = {"lang": "en_US", "tz": False, - "active_model": "account.cash.statement", - "active_ids": [ref("account_cash_statement_1")], - "active_id": ref("account_cash_statement_1"), } - self.with_context(context).button_open() -- - I check that now cash statement is in the "Open" state -- - !assert {model: account.cash.statement, id: account_cash_statement_1}: - - state == 'open' -- - I enter values in Closing balance before close the cashbox -- - !record {model: account.cash.statement, id: account_cash_statement_1, view: False}: - line_ids: - - amount: 1000.0 - date: !eval time.strftime('%Y-%m-%d') - name: test - partner_id: base.res_partner_4 - sequence: 0.0 - account_id: account.credit_account - balance_end: 1120.0 -- - I clicked on Close CashBox button to close the cashbox -- - !python {model: account.bank.statement, id: False}: | - self.browse(ref("account_bank_statement_1")).with_context({"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }).button_confirm_cash() -- - I check that bank statement state is now "Closed" -- - !assert {model: account.bank.statement, id: account_bank_statement_1}: - - state == 'confirm' - -- - I check that move lines created for cash statement and move state is Posted -- - !python {model: account.cash.statement, id: account_cash_statement_1}: | - move_line_obj = self.env['account.move.line'] - assert self.move_line_ids, "Move lines not created for cash statement" - for line in self.move_line_ids: - assert line.move_id.state == 'posted', "Move state is not posted" diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml deleted file mode 100644 index 24cefb19ced..00000000000 --- a/addons/account/test/account_report.yml +++ /dev/null @@ -1,69 +0,0 @@ -- - In order to test the PDF reports defined on an invoice, we will create a Invoice Record -- - !record {model: account.invoice, id: test_invoice_1}: - currency_id: base.EUR - company_id: base.main_company - partner_id: base.res_partner_1 - state: draft - type: out_invoice - account_id: account.a_recv - name: Test invoice 1 -- - In order to test the PDF reports defined on an invoice, we will print an Invoice Report -- - !python {model: account.invoice, id: False}: | - import os - from odoo import tools - data, format = ref('account.report_invoice').render(ref('account.account_invoice_customer0')) - if tools.config['test_report_directory']: - open(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) -- - In order to test the PDF reports defined on a partner, we will print the Overdue Report -- - !python {model: res.partner, id: False}: | - import os - from odoo import tools - data, format = ref('account.report_overdue').render([ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')]) - if tools.config['test_report_directory']: - open(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) -- - Print the Aged Partner Balance Report -- - !python {model: account.account, id: False}: | - ctx={} - data_dict = {'chart_account_id':ref('account.chart0')} - from odoo.tools import test_reports - test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account') -- - Print the Account Balance Sheet in Normal mode -- - !python {model: account.account, id: False}: | - ctx={} - data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')} - from odoo.tools import test_reports - test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account') -- - Print the Account Balance Report in Normal mode through the wizard - From Account Chart -- - !python {model: account.account, id: False}: | - ctx={} - data_dict = {'chart_account_id':ref('account.chart0')} - from odoo.tools import test_reports - test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account') -- - Print the General Ledger Report (in Landscape Mode) -- - !python {model: account.account, id: False}: | - ctx={} - data_dict = {'chart_account_id':ref('account.chart0')} - from odoo.tools import test_reports - test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account') -- - Print the Profit-Loss Report in Normal Mode -- - !python {model: account.account, id: False}: | - ctx={} - data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')} - from odoo.tools import test_reports - test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')