~agilebg/openobject-italia/imp_save_fiscalcode_data

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?xml version="1.0" encoding="utf-8"?>
<!--
#
#    OpenERP - Spanish Fiscal Year Closing
#    Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
#    $Id$
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
-->
<!--
Authors: Borja López Soilán (Pexego) - borja@kami.es
-->
<openerp>
    <data>

        <!-- Wizard tree view -->
        <record model="ir.ui.view" id="view_fyc_tree">
            <field name="name">account_fiscal_year_closing.fyc.tree</field>
            <field name="model">account_fiscal_year_closing.fyc</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Fiscal Year Closings" colors="red:state=='new';blue:state=='draft';green:state=='in_progress'">
                    <field name="company_id" select="1"/>
                    <field name="name" select="2"/>
                    <field name="closing_fiscalyear_id" select="1"/>
                    <field name="opening_fiscalyear_id" select="1"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <!-- Wizard form view -->
        <record model="ir.ui.view" id="view_fyc_form">
            <field name="name">account_fiscal_year_closing.fyc.form</field>
            <field name="model">account_fiscal_year_closing.fyc</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Fiscal Year Closing">
                    <group attrs="{'invisible':[('state','!=','new')]}" colspan="4">
                        <label string="Please, select the company, fiscal year to close and fiscal year to open." colspan="4"/>
                    </group>
                    <group colspan="4">
                        <field name="company_id" required="1" select="1" attrs="{'readonly':[('state','!=','new')]}"/>
                        <field name="name" select="2" attrs="{'readonly':[('state','!=','new')]}"/>
                    </group>
                    <group string="Fiscal Years" colspan="4">
                        <field name="closing_fiscalyear_id" attrs="{'readonly':[('state','!=','new')]}"/>
                        <field name="opening_fiscalyear_id" attrs="{'readonly':[('state','!=','new')]}"/>
                    </group>
                    <group attrs="{'invisible':[('state','!=','new')]}" colspan="4">
                        <button name="draft" string="Continue" states="new" icon="gtk-apply" colspan="4"/>
                    </group>
                    <group attrs="{'invisible':[('state','=','new')]}" colspan="4">
                        <notebook colspan="4">
                            <page string="General">
                                <group string="Operations" colspan="4">
                                    <group colspan="4">
                                        <separator string="Operation to perform" colspan="2"/>
                                        <separator string="Move created by the operation" colspan="2"/>
                                        <field name="create_loss_and_profit" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="loss_and_profit_move_id"/>
                                        <field name="create_net_loss_and_profit" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="net_loss_and_profit_move_id"/>
                                        <field name="create_closing" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="closing_move_id"/>
                                        <field name="create_opening" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="opening_move_id"/>
                                    </group>
                                    <separator string="Checks"/>
                                    <group colspan="4">
                                        <field name="check_invalid_period_moves" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="check_draft_moves" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="check_unbalanced_moves" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                    </group>
                                </group>
                                <group colspan="4" col="10">
                                    <field name="state" select="2" readonly="1"/>
                                    <button name="%(fyc_run_action)d"
                                        type="action"
                                        string="Perform the operations"
                                        icon="gtk-execute"
                                        states="draft,in_progress"/>
                                    <button name="confirm" string="Confirm" states="in_progress" icon="gtk-apply"/>
                                    <button name="cancel"
                                        string="Cancel"
                                        icon="gtk-cancel"
                                        states="in_progress,done"/>
                                    <button name="action_recover" string="Draft" type="object" states="canceled" icon="gtk-undo"/>
                                </group>
                            </page>
                            <page string="Configuration" attrs="{'invisible':[('state','=','new')]}">
                                <notebook colspan="4">
                                    <page string="Loss and Profit">
                                        <field name="lp_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="lp_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="lp_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="lp_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="lp_account_mapping_ids" colspan="4" nolabel="1" attrs="{'readonly':[('state','in',('done','cancel'))]}">
                                            <tree string="Account mappings" editable="top">
                                                <field name="source_account_id"/>
                                                <field name="dest_account_id" required="1"/>
                                            </tree>
                                            <form string="Account mapping">
                                                <field name="source_account_id"/>
                                                <field name="dest_account_id" required="1"/>
                                                <field name="name"/>
                                            </form>
                                        </field>
                                    </page>
                                    <page string="Net Loss and Profit">
                                        <field name="nlp_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="nlp_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="nlp_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="nlp_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="nlp_account_mapping_ids" colspan="4" nolabel="1" attrs="{'readonly':[('state','in',('done','cancel'))]}">
                                            <tree string="Account mappings" editable="top">
                                                <field name="source_account_id"/>
                                                <field name="dest_account_id"/>
                                            </tree>
                                            <form string="Account mapping">
                                                <field name="source_account_id"/>
                                                <field name="dest_account_id"/>
                                                <field name="name"/>
                                            </form>
                                        </field>
                                    </page>
                                    <page string="Closing">
                                        <field name="c_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="c_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="c_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="c_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="c_account_mapping_ids" colspan="4" nolabel="1" attrs="{'readonly':[('state','in',('done','cancel'))]}">
                                            <tree string="Accounts to close" editable="top">
                                                <field name="source_account_id"/>
                                            </tree>
                                            <form string="Account to close">
                                                <field name="source_account_id"/>
                                                <field name="name"/>
                                            </form>
                                        </field>
                                    </page>
                                    <page string="Opening">
                                        <field name="o_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="o_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="o_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                        <field name="o_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
                                    </page>
                                </notebook>
                            </page>
                        </notebook>
                    </group>
                </form>
            </field>
        </record>

        <!-- Menus and windows -->

        <record model="ir.actions.act_window" id="action_view_fyc_form">
            <field name="name">Close Fiscal Year</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">account_fiscal_year_closing.fyc</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
            <field name="view_id" ref="view_fyc_form"/>
        </record>

        <menuitem id="menu_fyc_new"
                    parent="account.menu_account_end_year_treatments"
                    name="Close Fiscal Year"
                    action="action_view_fyc_form"
                    sequence="10"/>

        <record model="ir.actions.act_window" id="action_view_fyc_tree">
            <field name="name">Fiscal Years Closings</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">account_fiscal_year_closing.fyc</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_fyc_tree"/>
        </record>

        <menuitem id="menu_fyc_list"
                    parent="account.menu_account_end_year_treatments"
                    name="Fiscal Years Closings"
                    action="action_view_fyc_tree"
                    sequence="11"/>

    </data>
</openerp>