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