[IMP] hr_recruitment: improved search views.
[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" class="oe_highlight"/>
113                         <button string="Approve" name="validate" states="confirm" type="workflow" class="oe_highlight"/>
114                         <button string="Done" name="done" states="validate" type="workflow" class="oe_highlight"/>
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                         <div class="oe_title">
121                             <label for="name" class="oe_edit_only"/>
122                             <h1>
123                                 <field name="name" attrs="{'readonly':[('state','!=','draft')]}"/>
124                             </h1>
125                         </div>
126                         <group>
127                             <group>
128                                 <field name="creating_user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
129                                 <field name="validating_user_id" readonly="True" attrs="{'readonly':[('state','!=','draft')]}"/>
130                             </group>
131                             <group>
132                                 <field name="code" attrs="{'readonly':[('state','!=','draft')]}"/>
133                                 <label for="date_from" string="Duration"/>
134                                 <div>
135                                     <field name="date_from" class="oe_inline" attrs="{'readonly':[('state','!=','draft')]}"/> - 
136                                     <field name="date_to" class="oe_inline" attrs="{'readonly':[('state','!=','draft')]}" nolabel="1"/>
137                                 </div>
138                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
139                             </group>
140                         </group>
141                         <notebook>
142                             <page string="Budget Lines">
143                                 <field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
144                                     <tree string="Budget Lines">
145                                         <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
146                                         <field name="general_budget_id"/>
147                                         <field name="date_from"/>
148                                         <field name="date_to"/>
149                                         <field name="paid_date"/>
150                                         <field name="planned_amount" sum="Planned Amount"/>
151                                         <field name="practical_amount" sum="Practical Amount"/>
152                                         <field name="theoritical_amount" sum="Theoretical Amount"/>
153                                         <field name="percentage"/>
154                                     </tree>
155                                     <form string="Budget Lines" version="7.0">
156                                         <group>
157                                             <group>
158                                                 <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
159                                                 <field name="general_budget_id"/>
160                                                 <field name="planned_amount"/>
161                                             </group>
162                                             <group>
163                                                 <label for="date_from" string="Duration"/>
164                                                 <div>
165                                                     <field name="date_from" class="oe_inline"/> - 
166                                                     <field name="date_to" class="oe_inline"/>
167                                                 </div>
168                                                 <field name="paid_date"/>
169                                                 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
170                                             </group>
171                                         </group>
172                                     </form>
173                                 </field>
174                             </page>
175                         </notebook>
176                     </sheet>
177                 </form>
178             </field>
179         </record>
180
181         <record model="ir.ui.view" id="crossovered_budget_view_tree">
182             <field name="name">crossovered.budget.view.tree</field>
183             <field name="model">crossovered.budget</field>
184             <field name="type">tree</field>
185             <field name="arch" type="xml">
186                <tree colors="blue:state == 'draft';gray:state in ('done','cancel');black:state in ('confirm','validate')" string="Budget">
187                     <field name="name" colspan="1"/>
188                     <field name="code" colspan="1"/>
189                     <field name="date_from"/>
190                     <field name="date_to"/>
191                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
192                     <field name="creating_user_id"/>
193                     <field name="state"/>
194                 </tree>
195             </field>
196         </record>
197
198         <record id="view_crossovered_budget_search" model="ir.ui.view">
199            <field name="name">crossovered.budget.search</field>
200            <field name="model">crossovered.budget</field>
201            <field name="type">search</field>
202            <field name="arch" type="xml">
203                <search string="Budget">
204                    <group>
205                         <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Budget"/>
206                         <separator orientation="vertical"/>
207                         <field name="date_from"/>
208                         <field name="date_to"/>
209                         <separator orientation="vertical"/>
210                         <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Draft Budgets"/>
211                         <filter string="To Approve" icon="terp-camera_test" domain="[('state','=','confirm')]" help="To Approve Budgets" />
212                         <separator orientation="vertical"/>
213                         <field name="state"/>
214                     </group>
215                 </search>
216             </field>
217         </record>
218
219         <record model="ir.actions.act_window" id="act_crossovered_budget_view">
220             <field name="name">Budgets</field>
221             <field name="res_model">crossovered.budget</field>
222             <field name="view_type">form</field>
223             <field name="view_mode">tree,form</field>
224             <field name="view_id" ref="crossovered_budget_view_tree"/>
225             <field name="search_view_id" ref="view_crossovered_budget_search"/>
226             <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>
227         </record>
228         <menuitem parent="next_id_31"
229             id="menu_act_crossovered_budget_view"
230             action="act_crossovered_budget_view" sequence="1" />
231
232         <record model="ir.ui.view" id="view_crossovered_budget_line_tree">
233             <field name="name">crossovered.budget.line.tree</field>
234             <field name="model">crossovered.budget.lines</field>
235             <field name="type">tree</field>
236             <field name="arch" type="xml">
237                 <tree string="Budget Lines">
238                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
239                     <field name="crossovered_budget_id" invisible="1"/>
240                     <field name="general_budget_id"/>
241                     <field name="date_from"/>
242                     <field name="date_to"/>
243                     <field name="paid_date"/>
244                     <field name="planned_amount"/>
245                     <field name="practical_amount"/>
246                     <field name="theoritical_amount"/>
247                     <field name="percentage"/>
248                 </tree>
249             </field>
250         </record>
251         <record model="ir.ui.view" id="view_crossovered_budget_line_form">
252             <field name="name">crossovered.budget.line.form</field>
253             <field name="model">crossovered.budget.lines</field>
254             <field name="type">form</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="type">form</field>
299             <field name="model">account.analytic.account</field>
300             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
301             <field name="arch" type="xml">
302                 <notebook position="inside">
303                     <page string="Budget Lines">
304                             <field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
305                                 <tree string="Budget Lines" editable="top">
306                                     <field name="crossovered_budget_id"/>
307                                     <field name="general_budget_id"/>
308                                     <field name="date_from"/>
309                                     <field name="date_to"/>
310                                     <field name="paid_date"/>
311                                     <field name="planned_amount"/>
312                                     <field name="practical_amount" sum="Practical Amount"/>
313                                     <field name="theoritical_amount" sum="Theoritical Amount"/>
314                                     <field name="percentage"/>
315                                 </tree>
316                                 <form string="Budget Lines">
317                                     <field name="crossovered_budget_id"/>
318                                     <field name="general_budget_id"/>
319                                     <field name="date_from"/>
320                                     <field name="date_to"/>
321                                     <field name="paid_date"/>
322                                     <field name="planned_amount"/>
323                                 </form>
324                                 <graph type="bar" string="Lines">
325                                     <field name="general_budget_id" />
326                                     <field name="planned_amount" operator="+"/>
327                                     <field group="True" name="analytic_account_id"/>
328                                 </graph>
329                             </field>
330                     </page>
331                 </notebook>
332             </field>
333         </record>
334
335     </data>
336 </openerp>
337
338