3 In order to check the Close a Fiscal Year wizard in OpenERP I first create a Fiscalyear
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)"
12 I create monthly Periods for this fiscalyear
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"),
20 I check that the fiscalyear state is "Draft"
22 !assert {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0, string: Fiscal Year is in Draft state}:
25 I run the Close a Fiscalyear wizard to close this fiscalyear
27 !record {model: account.fiscalyear.close.state, id: account_fiscalyear_close_state_0}:
28 fy_id: account_fiscalyear_fiscalyear0
30 I clicked on Close States Button to close fiscalyear
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"), })
38 I check that the fiscalyear state is now "Done"
40 !assert {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0, string: Fiscal Year is in Done state}: