[FIX] account: incorrect active_id context passed in tests of generic accounting...
[odoo/odoo.git] / addons / account / test / account_fiscalyear_close.yml
1 -
2   In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear to which the entries will move
3 -
4   !record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
5     code: !eval "'FY%s'% (datetime.now().year+1)"
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 %s' %(datetime.now().year+1)"
10 -
11   I create a period for the opening entries for the new fiscalyear
12 -
13   !record {model: account.period, id: account_period_jan11}:
14     company_id: base.main_company
15     date_start: !eval "'%s-01-01'% (datetime.now().year+1)"
16     date_stop: !eval "'%s-01-01'% (datetime.now().year+1)"
17     fiscalyear_id: account_fiscalyear_fiscalyear0
18     name: !eval "'OP %s' %(datetime.now().year+1)"
19     special: 1
20
21 -
22   I made modification in journal so it can move entries
23 -
24   !record {model: account.journal, id: account.close_journal}:
25     name: End of Year
26     code: NEW
27     type: situation
28     analytic_journal_id: sit
29     default_debit_account_id: cash
30     default_credit_account_id: cash
31     company_id: base.main_company
32     view_id: account_journal_bank_view
33     centralisation: 1
34 -
35   I called the Generate Fiscalyear Opening Entries wizard
36 -
37   !record {model: account.fiscalyear.close, id: account_fiscalyear_close_0}:
38     fy2_id: account_fiscalyear_fiscalyear0
39     fy_id: account.data_fiscalyear
40     journal_id: account.close_journal
41     period_id: account_period_jan11
42     report_name: End of Fiscal Year Entry
43 -
44   I clicked on create Button
45
46 -
47   !python {model: account.fiscalyear.close}: |
48     self.data_save(cr, uid, [ref("account_fiscalyear_close_0")], {"lang": 'en_US',
49       "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_fy_close")],
50       "tz": False, "active_id": ref("account.menu_wizard_fy_close"), })
51
52 -
53   I check the opening entries By using "Entries by Line wizard"
54 -
55   !record {model: account.move.journal, id: account_move_journal_0}:
56    {}
57 -
58   I clicked on Open Journal Button to check the entries
59
60 -
61   !python {model: account.move.journal}: |
62     self.action_open_window(cr, uid, [ref("account_move_journal_0")], {"lang": 'en_US',
63       "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")],
64       "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"),
65       })
66
67 #-
68 #  In order to test Cancel Opening Entries I cancelled the opening entries created for "Fiscal Year 2011"
69 #-
70 #  !record {model: account.open.closed.fiscalyear, id: account_open_closed_fiscalyear_1}:
71 #    fyear_id: account.data_fiscalyear
72 #-
73 #  I clicked on Open button
74 #-
75 #  !python {model: account.open.closed.fiscalyear}: |
76 #    self.remove_entries(cr, uid, [ref("account_open_closed_fiscalyear_1")], {"lang":
77 #      'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_wizard_open_closed_fy")],
78 #      "tz": False, "active_id": ref("account.menu_wizard_open_closed_fy"), })
79 #-
80 #  I check the opening entries By using "Entries by Line wizard"
81 #-
82 #  !record {model: account.move.journal, id: account_move_journal_2}:
83 #    journal_id: account.sales_journal
84 #    period_id: account_period_jan11
85 #
86 #-
87 #  I checked the Opening entries are cancelled successfully
88 #-
89 #  !python {model: account.move.journal}: |
90 #    self.action_open_window(cr, uid, [ref("account_move_journal_2")], {"lang": 'en_US',
91 #      "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")],
92 #      "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"),
93 #      })