[MERGE] minor cleanups
[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="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Budgetary Position"/>
22                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
23                 </search>
24             </field>
25         </record>
26
27         <record id="view_budget_post_tree" model="ir.ui.view">
28             <field name="name">account.budget.post.tree</field>
29             <field name="model">account.budget.post</field>
30             <field name="type">tree</field>
31             <field name="arch" type="xml">
32                 <tree string="Budgetary Position">
33                     <field name="code"/>
34                     <field name="name"/>
35                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
36                 </tree>
37             </field>
38         </record>
39
40         <record id="open_budget_post_form" model="ir.actions.act_window">
41             <field name="name">Budgetary Positions</field>
42             <field name="res_model">account.budget.post</field>
43             <field name="view_type">form</field>
44             <field name="view_id" ref="view_budget_post_tree"/>
45             <field name="search_view_id" ref="view_budget_post_search"/>
46         </record>
47         <menuitem id="next_id_31" name="Budgets" parent="account.menu_finance" sequence="6"/>
48         <menuitem id="next_id_pos" name="Budgets" parent="account.menu_finance_configuration" sequence="50"/>
49         <menuitem action="open_budget_post_form" id="menu_budget_post_form" parent="next_id_pos" sequence="20"/>
50
51
52         <record model="ir.ui.view" id="view_budget_post_form">
53             <field name="name">account.budget.post.form.inherit</field>
54             <field name="model">account.budget.post</field>
55             <field name="type">form</field>
56             <field name="arch" type="xml">
57                 <form string="Budgetary Position" version="7.0">
58                     <group col="4">
59                         <field name="name"/>
60                         <field name="code"/>
61                         <field name="company_id"  groups="base.group_multi_company" widget="selection"/>
62                     </group>
63                     <notebook>
64                         <page string="Accounts">
65                             <field name="account_ids"/>
66                         </page>
67                         <page string="Budget Lines">
68                             <field name="crossovered_budget_line" widget="one2many_list" mode="graph,tree">
69                                 <graph type="bar" string="Lines">
70                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
71                                     <field name="planned_amount" operator="+"/>
72                                     <field group="True" name="general_budget_id"/>
73                                 </graph>
74                                 <tree string="Budget Lines"  editable="top">
75                                     <field name="crossovered_budget_id"/>
76                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
77                                     <field name="date_from"/>
78                                     <field name="date_to"/>
79                                     <field name="paid_date"/>
80                                     <field name="planned_amount" sum="Planned Amount"/>
81                                     <field name="practical_amount" sum="Practical Amount" />
82                                     <field name="theoritical_amount" sum="Theoretical Amount"/>
83                                     <field name="percentage"/>
84                                 </tree>
85                                 <form string="Budget Lines" version="7.0">
86                                     <group col="4">
87                                         <field name="crossovered_budget_id"/>
88                                         <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
89                                         <field name="date_from"/>
90                                         <field name="date_to"/>
91                                         <field name="paid_date"/>
92                                         <field name="planned_amount"/>
93                                         <field name="practical_amount"/>
94                                         <field name="theoritical_amount"/>
95                                         <field name="percentage"/>
96                                     </group>
97                                 </form>
98                             </field>
99                         </page>
100                     </notebook>
101                 </form>
102             </field>
103         </record>
104
105         <record model="ir.ui.view" id="crossovered_budget_view_form">
106             <field name="name">crossovered.budget.view.form</field>
107             <field name="model">crossovered.budget</field>
108             <field name="type">form</field>
109             <field name="arch" type="xml">
110                 <form version="7.0">
111                 <header>
112                     <button string="Confirm" name="confirm" states="draft" type="workflow" />
113                     <button string="Approve" name="validate" states="confirm" type="workflow"/>
114                     <button string="Done" name="done" states="validate" type="workflow"   />
115                     <button name="draft" states="cancel" string="Reset to Draft" type="workflow"/>
116                     <button string="Cancel" name="cancel" states="confirm,validate" type="workflow"/>
117                     <field name="state" widget="statusbar" statusbar_visible="draft,confirm"/>
118                 </header>
119                 <sheet string="Budget">
120                     <group col="4">
121                             <field name="name" colspan="1" attrs="{'readonly':[('state','!=','draft')]}"/>
122                             <field name="code" colspan="1" attrs="{'readonly':[('state','!=','draft')]}"/>
123                             <field name="creating_user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
124                             <field name="validating_user_id" readonly="True" attrs="{'readonly':[('state','!=','draft')]}"/>
125                             <field name="date_from" attrs="{'readonly':[('state','!=','draft')]}"/>
126                             <field name="date_to" attrs="{'readonly':[('state','!=','draft')]}"/>
127                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
128                             <field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
129                                 <tree string="Budget Lines">
130                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
131                                     <field name="general_budget_id"/>
132                                     <field name="date_from"/>
133                                     <field name="date_to"/>
134                                     <field name="paid_date"/>
135                                     <field name="planned_amount" sum="Planned Amount"/>
136                                     <field name="practical_amount" sum="Practical Amount"/>
137                                     <field name="theoritical_amount" sum="Theoretical Amount"/>
138                                     <field name="percentage"/>
139                                 </tree>
140                                 <form string="Budget Lines" version="7.0">
141                                     <group col="4">
142                                         <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
143                                         <field name="general_budget_id"/>
144                                         <field name="date_from"/>
145                                         <field name="date_to"/>
146                                         <field name="paid_date"/>
147                                         <field name="planned_amount"/>
148                                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
149                                     </group>
150                                 </form>
151                             </field>
152                         </group>
153                     </sheet>
154                 </form>
155             </field>
156         </record>
157
158         <record model="ir.ui.view" id="crossovered_budget_view_tree">
159             <field name="name">crossovered.budget.view.tree</field>
160             <field name="model">crossovered.budget</field>
161             <field name="type">tree</field>
162             <field name="arch" type="xml">
163                <tree colors="blue:state == 'draft';gray:state in ('done','cancel');black:state in ('confirm','validate')" string="Budget">
164                     <field name="name" colspan="1"/>
165                     <field name="code" colspan="1"/>
166                     <field name="date_from"/>
167                     <field name="date_to"/>
168                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
169                     <field name="creating_user_id"/>
170                     <field name="state"/>
171                 </tree>
172             </field>
173         </record>
174
175         <record id="view_crossovered_budget_search" model="ir.ui.view">
176            <field name="name">crossovered.budget.search</field>
177            <field name="model">crossovered.budget</field>
178            <field name="type">search</field>
179            <field name="arch" type="xml">
180                <search string="Budget">
181                    <group>
182                         <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Budget"/>
183                         <separator orientation="vertical"/>
184                         <field name="date_from"/>
185                         <field name="date_to"/>
186                         <separator orientation="vertical"/>
187                         <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Draft Budgets"/>
188                         <filter string="To Approve" icon="terp-camera_test" domain="[('state','=','confirm')]" help="To Approve Budgets" />
189                         <separator orientation="vertical"/>
190                         <field name="state"/>
191                     </group>
192                 </search>
193             </field>
194         </record>
195
196         <record model="ir.actions.act_window" id="act_crossovered_budget_view">
197             <field name="name">Budgets</field>
198             <field name="res_model">crossovered.budget</field>
199             <field name="view_type">form</field>
200             <field name="view_mode">tree,form</field>
201             <field name="view_id" ref="crossovered_budget_view_tree"/>
202             <field name="search_view_id" ref="view_crossovered_budget_search"/>
203             <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>
204         </record>
205         <menuitem parent="next_id_31"
206             id="menu_act_crossovered_budget_view"
207             action="act_crossovered_budget_view" sequence="1" />
208
209         <record model="ir.ui.view" id="view_crossovered_budget_line_tree">
210             <field name="name">crossovered.budget.line.tree</field>
211             <field name="model">crossovered.budget.lines</field>
212             <field name="type">tree</field>
213             <field name="arch" type="xml">
214                 <tree string="Budget Lines">
215                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
216                     <field name="crossovered_budget_id" invisible="1"/>
217                     <field name="general_budget_id"/>
218                     <field name="date_from"/>
219                     <field name="date_to"/>
220                     <field name="paid_date"/>
221                     <field name="planned_amount"/>
222                     <field name="practical_amount"/>
223                     <field name="theoritical_amount"/>
224                     <field name="percentage"/>
225                 </tree>
226             </field>
227         </record>
228         <record model="ir.ui.view" id="view_crossovered_budget_line_form">
229             <field name="name">crossovered.budget.line.form</field>
230             <field name="model">crossovered.budget.lines</field>
231             <field name="type">form</field>
232             <field name="arch" type="xml">
233                 <form string="Budget Lines" version="7.0">
234                     <sheet>
235                         <group col="4">
236                             <field name="crossovered_budget_id"/>
237                             <field name="analytic_account_id"/>
238                             <field name="general_budget_id"/>
239                             <field name="date_from"/>
240                             <field name="date_to"/>
241                             <field name="paid_date"/>
242                             <field name="planned_amount"/>
243                             <field name="practical_amount"/>
244                             <field name="theoritical_amount"/>
245                             <field name="percentage"/>
246                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
247                         </group>
248                     </sheet>
249                 </form>
250             </field>
251         </record>
252
253         <record model="ir.actions.act_window" id="act_crossovered_budget_lines_view">
254             <field name="name">Budget Lines</field>
255             <field name="res_model">crossovered.budget.lines</field>
256             <field name="view_type">form</field>
257             <field name="view_mode">tree,form</field>
258             <field name="view_id" ref="view_crossovered_budget_line_tree"/>
259         </record>
260
261         <menuitem parent="menu_action_account_budget_post_tree"
262             id="menu_act_crossovered_budget_lines_view"
263             action="act_crossovered_budget_lines_view" />
264
265         <!--  Shortcuts -->
266         <act_window name="Budget Lines"
267             context="{'search_default_analytic_account_id': [active_id], 'default_analytic_account_id': active_id}"
268             res_model="crossovered.budget.lines"
269             src_model="account.analytic.account"
270             id="act_account_analytic_account_cb_lines"/>
271
272
273         <record model="ir.ui.view" id="view_account_analytic_account_form_inherit_budget">
274             <field name="name">account.analytic.account.form.inherot.budget</field>
275             <field name="type">form</field>
276             <field name="model">account.analytic.account</field>
277             <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
278             <field name="arch" type="xml">
279                 <notebook position="inside">
280                     <page string="Budget Lines">
281                             <field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
282                                 <tree string="Budget Lines" editable="top">
283                                     <field name="crossovered_budget_id"/>
284                                     <field name="general_budget_id"/>
285                                     <field name="date_from"/>
286                                     <field name="date_to"/>
287                                     <field name="paid_date"/>
288                                     <field name="planned_amount"/>
289                                     <field name="practical_amount" sum="Practical Amount"/>
290                                     <field name="theoritical_amount" sum="Theoritical Amount"/>
291                                     <field name="percentage"/>
292                                 </tree>
293                                 <form string="Budget Lines">
294                                     <field name="crossovered_budget_id"/>
295                                     <field name="general_budget_id"/>
296                                     <field name="date_from"/>
297                                     <field name="date_to"/>
298                                     <field name="paid_date"/>
299                                     <field name="planned_amount"/>
300                                 </form>
301                                 <graph type="bar" string="Lines">
302                                     <field name="general_budget_id" />
303                                     <field name="planned_amount" operator="+"/>
304                                     <field group="True" name="analytic_account_id"/>
305                                 </graph>
306                             </field>
307                     </page>
308                 </notebook>
309             </field>
310         </record>
311
312     </data>
313 </openerp>
314
315