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