43b936951e8fe4f8388d45678c2d8fbbde878558
[odoo/odoo.git] / addons / account_budget / account_budget_view.xml
1 <?xml version="1.0" ?>
2 <openerp>
3     <data>
4     <!-- budget form and tree view from account module *********************************** -->
5         <record id="action_account_budget_post_tree" model="ir.actions.act_window">
6             <field name="name">Budgets</field>
7             <field name="res_model">account.budget.post</field>
8             <field name="view_type">tree</field>
9         </record>
10         <menuitem action="action_account_budget_post_tree" id="menu_action_account_budget_post_tree" parent="account.menu_finance_generic_reporting" sequence="6"/>
11
12         <!--
13     Budgets
14     -->
15         <record id="view_budget_post_search" model="ir.ui.view">
16             <field name="name">account.budget.post.search</field>
17             <field name="model">account.budget.post</field>
18             <field name="type">search</field>
19             <field name="arch" type="xml">
20                 <search string="Budgetary Position">
21                     <field name="code"/>
22                     <field name="name"/>
23                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
24                 </search>
25             </field>
26         </record>
27
28         <record id="view_budget_post_tree" model="ir.ui.view">
29             <field name="name">account.budget.post.tree</field>
30             <field name="model">account.budget.post</field>
31             <field name="type">tree</field>
32             <field name="arch" type="xml">
33                 <tree string="Budgetary Position">
34                     <field name="code"/>
35                     <field name="name"/>
36                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
37                 </tree>
38             </field>
39         </record>
40
41         <record id="open_budget_post_form" model="ir.actions.act_window">
42             <field name="name">Budgetary Positions</field>
43             <field name="res_model">account.budget.post</field>
44             <field name="view_type">form</field>
45             <field name="view_id" ref="view_budget_post_tree"/>
46             <field name="search_view_id" ref="view_budget_post_search"/>
47         </record>
48         <menuitem id="next_id_31" name="Budgets" parent="account.menu_finance" sequence="6"/>
49         <menuitem id="next_id_pos" name="Budgets" parent="account.menu_finance_configuration" sequence="50"/>
50         <menuitem action="open_budget_post_form" id="menu_budget_post_form" parent="next_id_pos" sequence="20"/>
51
52
53         <record model="ir.ui.view" id="view_budget_post_form">
54             <field name="name">account.budget.post.form.inherit</field>
55             <field name="model">account.budget.post</field>
56             <field name="type">form</field>
57             <field name="arch" type="xml">
58                 <form string="Budgetary Position">
59                     <field name="name" select="1"/>
60                     <field name="code" select="1"/>
61                     <field name="company_id"  groups="base.group_multi_company" widget="selection"/>
62                     <notebook colspan="4">
63                         <page string="Accounts">
64                             <field name="account_ids" colspan="4" nolabel="1"/>
65                         </page>
66                         <page string="Budget Lines">
67                             <field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="graph,tree">
68                                 <graph type="bar" string="Lines">
69                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
70                                     <field name="planned_amount" operator="+"/>
71                                     <field group="True" name="general_budget_id"/>
72                                 </graph>
73                                 <tree string="Budget Lines"  editable="top">
74                                     <field name="crossovered_budget_id"/>
75                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
76                                     <field name="date_from"/>
77                                     <field name="date_to"/>
78                                     <field name="paid_date"/>
79                                     <field name="planned_amount" sum="Planned Amount"/>
80                                     <field name="practical_amount" select="1" sum="Practical Amount" />
81                                     <field name="theoritical_amount" sum="Theoretical Amount"/>
82                                     <field name="percentage"/>
83                                 </tree>
84                                 <form string="Budget Lines">
85                                     <field name="crossovered_budget_id"/>
86                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
87                                     <field name="date_from"/>
88                                     <field name="date_to"/>
89                                     <field name="paid_date"/>
90                                     <field name="planned_amount"/>
91                                     <field name="practical_amount" select="1"/>
92                                     <field name="theoritical_amount"/>
93                                     <field name="percentage"/>
94                                 </form>
95                             </field>
96                         </page>
97                     </notebook>
98                 </form>
99             </field>
100         </record>
101
102         <record model="ir.ui.view" id="crossovered_budget_view_form">
103             <field name="name">crossovered.budget.view.form</field>
104             <field name="model">crossovered.budget</field>
105             <field name="type">form</field>
106             <field name="arch" type="xml">
107                 <form string="Budget">
108                             <field name="name" colspan="1" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
109                             <field name="code" colspan="1" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
110                             <field name="creating_user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
111                             <field name="validating_user_id" readonly="True" attrs="{'readonly':[('state','!=','draft')]}"/>
112                             <field name="date_from" attrs="{'readonly':[('state','!=','draft')]}"/>
113                             <field name="date_to" attrs="{'readonly':[('state','!=','draft')]}"/>
114                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
115                             <field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
116                                 <tree string="Budget Lines">
117                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
118                                     <field name="general_budget_id"/>
119                                     <field name="date_from"/>
120                                     <field name="date_to"/>
121                                     <field name="paid_date"/>
122                                     <field name="planned_amount" sum="Planned Amount"/>
123                                     <field name="practical_amount" sum="Practical Amount"/>
124                                     <field name="theoritical_amount" sum="Theoretical Amount"/>
125                                     <field name="percentage"/>
126                                 </tree>
127                                 <form string="Budget Lines">
128                                     <field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
129                                     <field name="general_budget_id" select="1"/>
130                                     <field name="date_from"/>
131                                     <field name="date_to"/>
132                                     <field name="paid_date" select="1"/>
133                                     <field name="planned_amount" select="1"/>
134                                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
135                                 </form>
136                             </field>
137                             <field name="state" select="1"/>
138                             <group col="4" colspan="2">
139                                 <button string="Cancel" name="cancel" states="confirm,validate" type="workflow" icon="gtk-cancel"/>
140                                 <button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-apply" />
141                                 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-ok"/>
142                                 <button string="Done" name="done" states="validate" type="workflow"   icon="gtk-jump-to" />
143                                 <button name="draft" states="cancel" string="Reset to Draft" type="workflow" icon="terp-stock_effects-object-colorize"/>
144                             </group>
145
146                 </form>
147             </field>
148         </record>
149
150         <record model="ir.ui.view" id="crossovered_budget_view_tree">
151             <field name="name">crossovered.budget.view.tree</field>
152             <field name="model">crossovered.budget</field>
153             <field name="type">tree</field>
154             <field name="arch" type="xml">
155                <tree colors="blue:state == 'draft';gray:state in ('done','cancel');black:state in ('confirm','validate')" string="Budget">
156                     <field name="name" colspan="1"/>
157                     <field name="code" colspan="1"/>
158                     <field name="date_from"/>
159                     <field name="date_to"/>
160                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
161                     <field name="creating_user_id"/>
162                     <field name="state"/>
163                 </tree>
164             </field>
165         </record>
166
167         <record id="view_crossovered_budget_search" model="ir.ui.view">
168            <field name="name">crossovered.budget.search</field>
169            <field name="model">crossovered.budget</field>
170            <field name="type">search</field>
171            <field name="arch" type="xml">
172                <search string="Budget">
173                    <group>
174                        <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Draft Budgets"/>
175                        <filter string="To Approve" icon="terp-camera_test" domain="[('state','=','confirm')]" help="To Approve Budgets" />
176                        <separator orientation="vertical"/>
177                        <field name="name"/>
178                        <field name="code" />
179                        <field name="state"/>
180                        <field name="date_from"/>
181                        <field name="date_to"/>
182                    </group>
183                </search>
184            </field>
185         </record>
186
187         <record model="ir.actions.act_window" id="act_crossovered_budget_view">
188             <field name="name">Budgets</field>
189             <field name="res_model">crossovered.budget</field>
190             <field name="view_type">form</field>
191             <field name="view_mode">tree,form</field>
192             <field name="view_id" ref="crossovered_budget_view_tree"/>
193             <field name="search_view_id" ref="view_crossovered_budget_search"/>
194             <field name="help">A budget is a forecast of your company's income and expenses expected for a period in the future. With a budget, a company is able to carefully look at how much money they are taking in during a given period, and figure out the best way to divide it among various categories. By keeping track of where your money goes, you may be less likely to overspend, and more likely to meet your financial goals. Forecast a budget by detailing the expected revenue per analytic account and monitor its evolution based on the actuals realised during that period.</field>
195         </record>
196         <menuitem parent="next_id_31"
197             id="menu_act_crossovered_budget_view"
198             action="act_crossovered_budget_view" sequence="1" />
199
200         <record model="ir.ui.view" id="view_crossovered_budget_line_tree">
201             <field name="name">crossovered.budget.line.tree</field>
202             <field name="model">crossovered.budget.lines</field>
203             <field name="type">tree</field>
204             <field name="arch" type="xml">
205                 <tree string="Budget Lines">
206                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
207                     <field name="crossovered_budget_id" invisible="1"/>
208                     <field name="general_budget_id"/>
209                     <field name="date_from"/>
210                     <field name="date_to"/>
211                     <field name="paid_date"/>
212                     <field name="planned_amount"/>
213                     <field name="practical_amount"/>
214                     <field name="theoritical_amount"/>
215                     <field name="percentage"/>
216                 </tree>
217             </field>
218         </record>
219         <record model="ir.ui.view" id="view_crossovered_budget_line_form">
220             <field name="name">crossovered.budget.line.form</field>
221             <field name="model">crossovered.budget.lines</field>
222             <field name="type">form</field>
223             <field name="arch" type="xml">
224                 <form string="Budget Lines">
225                     <field name="crossovered_budget_id"/>
226                     <field name="analytic_account_id"/>
227                     <field name="general_budget_id"/>
228                     <field name="date_from"/>
229                     <field name="date_to"/>
230                     <field name="paid_date"/>
231                     <field name="planned_amount"/>
232                     <field name="practical_amount"/>
233                     <field name="theoritical_amount"/>
234                     <field name="percentage"/>
235                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
236                 </form>
237             </field>
238         </record>
239
240         <record model="ir.actions.act_window" id="act_crossovered_budget_lines_view">
241             <field name="name">Budget Lines</field>
242             <field name="res_model">crossovered.budget.lines</field>
243             <field name="view_type">form</field>
244             <field name="view_mode">tree,form</field>
245             <field name="view_id" ref="view_crossovered_budget_line_tree"/>
246         </record>
247
248         <menuitem parent="menu_action_account_budget_post_tree"
249             id="menu_act_crossovered_budget_lines_view"
250             action="act_crossovered_budget_lines_view" />
251
252         <!--  Shortcuts -->
253         <act_window name="Budget Lines"
254             context="{'search_default_analytic_account_id': [active_id], 'default_analytic_account_id': active_id}"
255             res_model="crossovered.budget.lines"
256             src_model="account.analytic.account"
257             id="act_account_analytic_account_cb_lines"/>
258
259
260         <record model="ir.ui.view" id="view_account_analytic_account_form_inherit_budget">
261             <field name="name">account.analytic.account.form.inherot.budget</field>
262             <field name="type">form</field>
263             <field name="model">account.analytic.account</field>
264             <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
265             <field name="arch" type="xml">
266                 <notebook position="inside">
267                     <page string="Budget Lines">
268                             <field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
269                                 <tree string="Budget Lines" editable="top">
270                                     <field name="crossovered_budget_id"/>
271                                     <field name="general_budget_id"/>
272                                     <field name="date_from"/>
273                                     <field name="date_to"/>
274                                     <field name="paid_date"/>
275                                     <field name="planned_amount"/>
276                                     <field name="practical_amount" sum="Practical Amount"/>
277                                     <field name="theoritical_amount" sum="Theoritical Amount"/>
278                                     <field name="percentage"/>
279                                 </tree>
280                                 <form string="Budget Lines">
281                                     <field name="crossovered_budget_id"/>
282                                     <field name="general_budget_id"/>
283                                     <field name="date_from"/>
284                                     <field name="date_to"/>
285                                     <field name="paid_date"/>
286                                     <field name="planned_amount"/>
287                                 </form>
288                                 <graph type="bar" string="Lines">
289                                     <field name="general_budget_id" />
290                                     <field name="planned_amount" operator="+"/>
291                                     <field group="True" name="analytic_account_id"/>
292                                 </graph>
293                             </field>
294                     </page>
295                 </notebook>
296             </field>
297         </record>
298
299     </data>
300 </openerp>
301
302