[MERGE] sync with latest trunk
[odoo/odoo.git] / addons / account / test / account_period_close.yml
1
2 -
3   In order to test close period wizard I create a period then close it and checked it's state
4 -
5   !record {model: account.period, id: account_period_jan0}:
6     company_id: base.main_company
7     date_start: !eval "'%s-01-01' %(datetime.now().year)"
8     date_stop: !eval "'%s-01-31' %(datetime.now().year)"
9     fiscalyear_id: account.data_fiscalyear
10     name: !eval "'Jan-%s' %(datetime.now().year)"
11     special: 1
12
13 -
14   I check that the period state is "Draft"
15 -
16   !assert {model: account.period, id: account_period_jan0, string: Period is in Draft state}:
17     - state == 'draft'
18 -
19   I use "Close a Period" wizard to close period
20 -
21   !record {model: account.period.close, id: account_period_close_0}:
22     sure: 1
23 -
24   I clicked on Close Period Button to close Period
25
26 -
27   !python {model: account.period.close}: |
28     self.data_save(cr, uid, [ref("account_period_close_0")], {"lang": 'en_US', "active_model":
29       "account.period", "active_ids": [ref("account_period_jan0")], "tz": False, "active_id":
30       ref("account_period_jan0"), })
31 -
32   I check that the period state is "Done"
33 -
34   !assert {model: account.period, id: account_period_jan0, string: Period is in Done state}:
35     - state == 'done'