[IMP] account: improve edi import of invoice to split in different stuff
[odoo/odoo.git] / addons / account / test / account_fiscalyear_close_state.yml
1
2 -
3   In order to check the Close a Fiscal Year wizard in OpenERP I first create a Fiscalyear
4 -
5   !record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
6     code: !eval "'FY%s'% (datetime.now().year+1)"
7     company_id: base.main_company
8     date_start: !eval "'%s-01-01' %(datetime.now().year+1)"
9     date_stop: !eval "'%s-12-31' %(datetime.now().year+1)"
10     name: !eval "'Fiscal Year %s' %(datetime.now().year+1)"
11 -
12   I create monthly Periods for this fiscalyear
13 -
14   !python {model: account.fiscalyear}: |
15     self.create_period(cr, uid, [ref("account_fiscalyear_fiscalyear0")], {"lang":
16       'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_account_fiscalyear_form")],
17       "tz": False, "active_id": ref("account.menu_action_account_fiscalyear_form"),
18       })
19 -
20   I check that the fiscalyear state is "Draft"
21 -
22   !assert {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0, string: Fiscal Year is in Draft state}:
23     - state == 'draft'
24 -
25   I run the Close a Fiscalyear wizard to close this fiscalyear
26 -
27   !record {model: account.fiscalyear.close.state, id: account_fiscalyear_close_state_0}:
28     fy_id: account_fiscalyear_fiscalyear0
29 -
30   I clicked on Close States Button to close fiscalyear
31
32 -
33   !python {model: account.fiscalyear.close.state}: |
34     self.data_save(cr, uid, [ref("account_fiscalyear_close_state_0")], {"lang": 'en_US',
35       "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_fy_close_state")],
36       "tz": False, "active_id": ref("account.menu_wizard_fy_close_state"), })
37 -
38   I check that the fiscalyear state is now "Done"
39 -
40   !assert {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0, string: Fiscal Year is in Done state}:
41     - state == 'done'
42
43
44
45