3 In order to test close period wizard I first create a dummy fiscal year in the past to avoid conflicts related to closed periods
5 !record {model: account.fiscalyear, id: data_fiscalyear_minus1}:
6 company_id: base.main_company
7 date_start: !eval "'%s-01-01' %(datetime.now().year-1)"
8 date_stop: !eval "'%s-12-31' %(datetime.now().year-1)"
9 name: !eval "'Fiscal Year X %s' %(datetime.now().year-1)"
10 code: !eval "'FY%s' %(datetime.now().year-1)"
13 I create a period then close it and checked it's state
15 !record {model: account.period, id: account_period_jan0}:
16 company_id: base.main_company
17 date_start: !eval "'%s-01-01' %(datetime.now().year-1)"
18 date_stop: !eval "'%s-01-31' %(datetime.now().year-1)"
19 fiscalyear_id: data_fiscalyear_minus1
20 name: !eval "'Jan-%s' %(datetime.now().year-1)"
24 I check that the period state is "Draft"
26 !assert {model: account.period, id: account_period_jan0, string: Period is in Draft state}:
29 I use "Close a Period" wizard to close period
31 !record {model: account.period.close, id: account_period_close_0}:
34 I clicked on Close Period Button to close Period
37 !python {model: account.period.close}: |
38 self.data_save(cr, uid, [ref("account_period_close_0")], {"lang": 'en_US', "active_model":
39 "account.period", "active_ids": [ref("account_period_jan0")], "tz": False, "active_id":
40 ref("account_period_jan0"), })
42 I check that the period state is "Done"
44 !assert {model: account.period, id: account_period_jan0, string: Period is in Done state}: