[IMP] website: load website.xml templates only in editable mode
[odoo/odoo.git] / addons / analytic_contract_hr_expense / analytic_contract_hr_expense_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record id="account_analytic_account_form_expense_form" model="ir.ui.view">
5             <field name="name">account.analytic.account.form.expense.inherit</field>
6             <field name="model">account.analytic.account</field>
7             <field eval="60" name="priority"/>
8             <field name="inherit_id" ref="account_analytic_analysis.account_analytic_account_form_form"/>
9             <field name="arch" type="xml">
10                 <xpath expr='//tr[@name="total"]' position='before'>
11                     <tr>
12                         <td class="oe_timesheet_grey">
13                             <label for="charge_expenses"/>
14                         </td><td class="oe_timesheet_grey">
15                             <field name="charge_expenses"/>
16                         </td><td>
17                             <field class="oe_form_inline" name="est_expenses" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
18                         </td><td>
19                             <field class="oe_form_inline" name="expense_invoiced" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
20                         </td><td>
21                             <field class="oe_form_inline" name="remaining_expense" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
22                         </td><td>
23                             <field class="oe_form_inline" name="expense_to_invoice" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
24                         </td><td attrs="{'invisible': [('charge_expenses','=',False)]}" class="oe_timesheet_action">
25                             <span attrs="{'invisible': [('expense_to_invoice','=',0)]}" class="oe_grey">
26                                 <button
27                                     name="hr_to_invoice_expense"
28                                     class="oe_link"
29                                     string="⇒ Invoice" type="object"
30                                     />
31                                 or view
32                             </span>
33                             <span attrs="{'invisible': [('expense_to_invoice','&lt;&gt;',0)]}" class="oe_grey">
34                                 Nothing to invoice, create 
35                             </span>
36                             <button
37                                 name="open_hr_expense"
38                                 class="oe_link"
39                                 string="Expenses" type="object"/>
40                         </td>
41                     </tr>
42                 </xpath>
43                 <xpath expr="//p[@name='invoice_on_timesheets_label']" position="attributes">
44                     <attribute name="attrs">{'invisible': [('invoice_on_timesheets','=',False),('charge_expenses','=',False)]}</attribute>
45                 </xpath>
46                 <xpath expr="//field[@name='pricelist_id']" position="attributes">
47                     <attribute name="attrs">{'required': ['|',('invoice_on_timesheets','=',True),('charge_expenses','=',True)], 'invisible':[('invoice_on_timesheets','=',False), ('charge_expenses','=',False)]}</attribute>
48                 </xpath>
49                 <xpath expr="//field[@name='to_invoice']" position="attributes">
50                     <attribute name="attrs">{'required': ['|',('invoice_on_timesheets','=',True),('charge_expenses','=',True)]}</attribute>
51                     <attribute name="string">Expenses and Timesheet Invoicing Ratio</attribute>
52                 </xpath>
53             </field>
54         </record>
55         
56         <!--<record id="project_form_expense_form" model="ir.ui.view">
57             <field name="name">project.project.form.expense.inherit</field>
58             <field name="model">project.project</field>
59             <field name="inherit_id" ref="analytic_contract_project.project_account_analytic_account_form"/>
60             <field eval="20" name="priority"/>
61             <field name="arch" type="xml">
62                 <xpath expr='//div[@name="end_of_tabl_hook"]' position='before'>
63                         <tr>
64                             <th class="oe_border_right">Charge Expenses</th>
65                             <td><field name="charge_expenses" nolabel="1"/></td>
66                             <td><field class="oe_th_110px" name="est_expenses" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
67                             <td class="oe_th_110px"><field name="expense_invoiced" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
68                             <td class="oe_th_110px oe_border_right"><field name="remaining_expense" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
69                             <td class="oe_th_110px"><field name="expense_to_invoice" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
70                             <td width="10px"></td>
71                             <td><button icon="gtk-select-all" class= "oe_btn_width" name="open_hr_expense" string="Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
72                             <td><button icon="terp-dolar" class= "oe_btn_width" name="hr_to_invoiced_expense" string="Invoice Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
73                         </tr>
74                 </xpath>
75             </field>
76         </record>-->
77     </data>
78 </openerp>