[MERGE] forward port of branch 8.0 up to 591e329
[odoo/odoo.git] / addons / analytic_user_function / analytic_user_function_view.xml
1 <?xml version="1.0" ?>
2 <openerp>
3     <data>
4
5         <!-- analytic_user_funct_grid views -->
6         <record model="ir.ui.view" id="analytic_user_funct_grid_tree">
7             <field name="name">analytic_user_funct_grid.tree</field>
8             <field name="model">analytic.user.funct.grid</field>
9             <field name="arch" type="xml">
10                 <tree string="Invoicing Data" editable="bottom">
11                     <field name="user_id" on_change="onchange_user_product_id(user_id, product_id)" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman']}"/>
12                     <field name="product_id" on_change="onchange_user_product_id(user_id, product_id)" domain="[('type','=','service')]"/>
13                     <field name="price"/>
14                     <field name="uom_id" groups="product.group_uom"/>
15                 </tree>
16             </field>
17         </record>
18
19         <record model="ir.ui.view" id="analytic_user_funct_grid_form">
20             <field name="name">analytic_user_funct_grid.form</field>
21             <field name="model">analytic.user.funct.grid</field>
22             <field name="arch" type="xml">
23                 <form string="Invoicing Data">
24                     <group>
25                         <field name="user_id" on_change="onchange_user_product_id(user_id, product_id)" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman']}"/>
26                         <field name="product_id" domain="[('type','=','service')]" on_change="onchange_user_product_id(user_id, product_id)"/>
27                         <field name="price"/>
28                         <field name="uom_id" groups="product.group_uom"/>
29                     </group>
30                 </form>
31             </field>
32         </record>
33
34         <!-- account.analytic.account inherited view -->
35         <record model="ir.ui.view" id="view_account_analytic_account_form_inherit">
36             <field name="name">account.analytic.account.form</field>
37             <field name="model">account.analytic.account</field>
38             <field eval="60" name="priority"/>
39             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
40             <field name="arch" type="xml">
41                 <separator name="description" position="before">
42                     <div name="user_function_price" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
43                         <separator string="Invoice Price Rate per User"/>
44                         <p class="oe_grey oe_edit_only">
45                             Define a specific service (e.g. Senior Consultant)
46                             and price for some users to use these data instead
47                             of the default values when invoicing the customer.
48                         </p>
49                         <p class="oe_grey oe_edit_only">
50                             Odoo will recursively search on parent accounts
51                             to check if specific conditions are defined for a
52                             specific user. This allows to set invoicing
53                             conditions for a group of contracts.
54                         </p>
55                         <field name="user_product_ids"/>
56                     </div>
57                 </separator>
58             </field>
59         </record>
60
61         <!-- hr_timesheet_sheet.sheet inherited view -->
62         <record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit">
63             <field name="name">hr.timesheet.sheet.form.tree</field>
64             <field name="model">hr_timesheet_sheet.sheet</field>
65             <field name="priority" eval="18"/>
66             <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
67             <field name="arch" type="xml">
68                 <xpath expr="//field[@name='timesheet_ids']/tree/field[@name='account_id']" position="attributes">
69                     <attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount)</attribute>
70                 </xpath>
71             </field>
72         </record>
73
74         <!-- hr_timesheet_sheet.sheet inherited view -->
75         <record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit1">
76             <field name="name">hr.timesheet.sheet.form.form</field>
77             <field name="model">hr_timesheet_sheet.sheet</field>
78             <field name="priority" eval="19"/>
79             <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
80             <field name="arch" type="xml">
81                 <xpath expr="//field[@name='timesheet_ids']/form/field[@name='account_id']" position="replace">
82                     <field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)" context="{'default_invoice_on_timesheets': 1}"/>
83                 </xpath>
84             </field>
85         </record>
86
87         <!-- hr.analytic.timesheet inherited views -->
88         <record model="ir.ui.view" id="hr_timesheet_line_form_inherit">
89             <field name="name">hr.analytic.timesheet.form</field>
90             <field name="model">hr.analytic.timesheet</field>
91             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
92             <field name="arch" type="xml">
93                 <xpath expr="//field[@name='account_id']" position="replace">
94                     <field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)" />
95                 </xpath>
96             </field>
97         </record>
98
99         <record model="ir.ui.view" id="hr_timesheet_line_form_inherit_2">
100             <field name="name">hr.analytic.timesheet.form</field>
101             <field name="model">hr.analytic.timesheet</field>
102             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
103             <field name="arch" type="xml">
104                 <xpath expr="//field[@name='user_id']" position="replace">
105                     <field name="user_id"  required="1" on_change="on_change_user_id(user_id, account_id, unit_amount)"/>
106                 </xpath>
107             </field>
108         </record>
109
110         <record model="ir.ui.view" id="hr_timesheet_line_tree_inherit">
111             <field name="name">hr.analytic.timesheet.tree</field>
112             <field name="model">hr.analytic.timesheet</field>
113             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
114             <field name="arch" type="xml">
115                 <xpath expr="/tree/field[@name='account_id']" position="replace">
116                     <field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)" />
117                 </xpath>
118             </field>
119         </record>
120
121         <record model="ir.ui.view" id="hr_timesheet_line_tree_inherit_2">
122             <field name="name">hr.analytic.timesheet.tree</field>
123             <field name="model">hr.analytic.timesheet</field>
124             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
125             <field name="arch" type="xml">
126                 <xpath expr="/tree/field[@name='user_id']" position="replace">
127                     <field name="user_id"  required="1" on_change="on_change_user_id(user_id, account_id, unit_amount)" context="{'default_groups_ref': ['base.group_user']}"/>
128                 </xpath>
129             </field>
130         </record>
131
132     </data>
133 </openerp>