[IMP] account: improve edi import of invoice to split in different stuff
[odoo/odoo.git] / addons / account / test / account_bank_statement.yml
1 -
2   In order to test Bank Statement feature of account I create a bank statement line and confirm it and check it's move created
3 -
4   I create a bank statement with Opening and Closing balance 0.
5 -
6   !record {model: account.bank.statement, id: account_bank_statement_0}:
7     balance_end_real: 0.0
8     balance_start: 0.0
9     date: !eval time.strftime('%Y-%m-%d')
10     journal_id: account.bank_journal
11     name: /
12     period_id: account.period_10
13     line_ids:
14       - account_id: account.a_recv
15         amount: 1000.0
16         date: !eval time.strftime('%Y-%m-%d')
17         name: a
18         partner_id: base.res_partner_4
19         sequence: 0.0
20         type: general
21 -
22   I check that Initially bank statement is in the "Draft" state
23 -
24   !assert {model: account.bank.statement, id: account_bank_statement_0}:
25     - state == 'draft'
26 -
27   I compute bank statement using Compute button
28 -
29   !python {model: account.bank.statement}: |
30     self.button_dummy(cr, uid, [ref("account_bank_statement_0")], {"lang": "en_US",
31       "tz": False, "active_model": "ir.ui.menu", "journal_type": "bank", "section_id":
32       False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")],
33       "active_id": ref("account.menu_bank_statement_tree"), })
34
35 -
36   I modify the bank statement and set the Closing Balance.
37 -
38   !record {model: account.bank.statement, id: account_bank_statement_0}:
39     balance_end_real: 1000.0
40
41 -
42   I confirm the bank statement using Confirm button
43 -
44   !python {model: account.bank.statement}: |
45     self.button_confirm_bank(cr, uid, [ref("account_bank_statement_0")], {"lang":
46       "en_US", "tz": False, "active_model": "ir.ui.menu", "journal_type": "bank",
47       "section_id": False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")],
48       "active_id": ref("account.menu_bank_statement_tree"), })
49 -
50   I check that bank statement state is now "Closed"
51 -
52   !assert {model: account.bank.statement, id: account_bank_statement_0}:
53     - state == 'confirm'
54
55 -
56   I check that move lines created for bank statement and move state is Posted
57 -
58   !python {model: account.bank.statement}: |
59     move_line_obj = self.pool.get('account.move.line')
60     bank_data = self.browse(cr, uid, ref("account_bank_statement_0"))
61     assert bank_data.move_line_ids, "Move lines not created for bank statement"
62     for line in bank_data.move_line_ids:
63       assert line.move_id.state == 'posted', "Move state is not posted"