[IMP]:improved view code
[odoo/odoo.git] / addons / account_analytic_analysis / account_analytic_analysis_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!--
6         Analytic Account form
7
8         Remove information on Account data => because they move on analysis sheet
9         create a page with invoicing informations
10        
11         <record id="account_analytic_account_invoice_stat_form" model="ir.ui.view">
12             <field name="name">account.analytic.account.invoice.stat.form.inherit</field>
13             <field name="model">account.analytic.account</field>
14             <field name="type">form</field>
15             <field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
16             <field eval="18" name="priority"/>
17             <field name="arch" type="xml">
18                 <group name="invoice_stats" position="inside">
19                     <field name="hours_qtt_non_invoiced" attrs="{'invisible': [('to_invoice','=',0)]}"/>
20                     <field name="ca_to_invoice" attrs="{'invisible': [('to_invoice','=',0)]}"/>
21                     <label string="" colspan="1"/>
22                     <button
23                         name="%(hr_timesheet_invoice.action_hr_timesheet_invoice_create_final)d"
24                         string="Create Invoice"
25                         type="action"
26                         attrs="{'readonly':[('ca_to_invoice','=',0.0)], 'invisible': [('to_invoice','=',0)]}"
27                         icon="gtk-go-forward"/>
28                 </group>
29             </field>
30         </record> -->
31         <act_window
32             id="action_sales_order_line"
33             name="Sales Order Lines"
34             res_model="sale.order.line"
35             src_model="account.analytic.account"
36             />
37             
38         <record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
39             <field name="name">account.analytic.account.invoice.form.inherit</field>
40             <field name="model">account.analytic.account</field>
41             <field name="type">form</field>
42             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
43             <field eval="18" name="priority"/>
44             <field name="arch" type="xml">
45                 <xpath expr='//field[@name="parent_id"]' position='after'>
46                     <field name="template_id" on_change="on_change_template(template_id)"  domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
47                 </xpath>
48                 <xpath expr='//group[@name="project"]' position="after">
49                     <group col="6" colspan="3" class="oe_form_group_label_border">
50                         <field name="quantity_max"/><label string="/"/> <label string="Remaining"/> <field name="remaining_hours" nolabel="1"/>
51                     </group>
52                 </xpath>
53                 <xpath expr='//separator[@name="description"]' position='before'>
54                     <separator colspan="4" string="Invoicing" name="invoicing"/>
55                     <group col="1" colspan="4">
56                         <table border="0">
57                             <tr>
58                                 <th class="oe_th_137px" height="20px"></th>
59                                 <th width="10px"></th>
60                                 <th class="oe_th_110px">Est.Tot</th>
61                                 <th class="oe_th_110px">Invoiced</th>
62                                 <th class="oe_th_110px">Remaining</th>
63                                 <th class="oe_th_110px">Ready To Invoice</th>
64                                 <th width="10px"></th>
65                                 <th class="oe_th_150px"></th>
66                                 <th class="oe_th_150px"></th>
67                             </tr>
68                             <tr>
69                                 <th class="oe_border_right">Fix Price Invoices</th>
70                                 <td><field name="fix_price_invoices" nolabel="1"/></td>
71                                 <td class="oe_amount_center oe_th_110px"><field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
72                                 <td class="oe_amount_center oe_th_110px"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
73                                 <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
74                                 <td class="oe_amount_center oe_th_110px"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
75                                 <td width="10px"></td>
76                                 <td class="oe_th_150px"><button class= "oe_btn_width" name="%(action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
77                                 <td class="oe_th_150px"><button class= "oe_btn_width" name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
78                             </tr>
79                             <tr>
80                                 <th class="oe_border_right">Invoice On Timesheets</th>
81                                 <td><field name="invoice_on_timesheets" nolabel="1"/></td>
82                                 <td class="oe_amount_center oe_th_110px"><field name="quantity_max" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
83                                 <td class="oe_amount_center oe_th_110px"><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
84                                 <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
85                                 <td class="oe_amount_center oe_th_110px"><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
86                                 <td width="10px"></td>
87                                 <td class="oe_th_150px"><button class= "oe_btn_width" name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
88                                 <td class="oe_th_150px"><button class= "oe_btn_width" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
89                             </tr>
90                             <tr>
91                                 <th class="oe_border_right">Charge Expenses</th>
92                                 <td><field name="charge_expenses" nolabel="1"/></td>
93                                 <td class="oe_amount_center oe_th_110px"><field name="expense_max" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
94                                 <td class="oe_amount_center oe_th_110px"><field name="expense_invoiced" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
95                                 <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_expense" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
96                                 <td class="oe_amount_center oe_th_110px"><field name="expense_to_invoice" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
97                                 <td width="10px"></td>
98                                 <td class="oe_th_150px"><button class= "oe_btn_width" name="open_hr_expense" string="Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
99                                 <td class="oe_th_150px"><button class= "oe_btn_width" name="hr_to_invoiced_expense" string="Invoice Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
100                             </tr>
101                             <tr>
102                                 <th class="oe_border_right">Total</th>
103                                 <td width="10px"></td>
104                                 <td class="oe_amount_center oe_th_110px oe_border_top"><field name="est_total" nolabel="1"/></td>
105                                 <td class="oe_amount_center oe_th_110px oe_border_top"><field name="invoiced_total" nolabel="1"/></td>
106                                 <td class="oe_amount_center oe_th_110px oe_border_right oe_border_top"><field name="remaining_total" nolabel="1"/></td>
107                                 <td class="oe_amount_center oe_th_110px oe_border_top"><field name="toinvoice_total" nolabel="1"/></td>
108                             </tr>
109                         </table>
110                     </group>
111                     <group colspan="4" class="oe_form_group_label_border">
112                         <field name="pricelist_id" attrs="{'invisible': [('invoice_on_timesheets','!=',True),('charge_expenses','!=',True)]}"/>
113                         <field name="to_invoice" widget="selection" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>
114                     </group>
115                 </xpath>
116             </field>
117         </record>
118
119         <record id="project_account_analytic_account_form" model="ir.ui.view">
120             <field name="name">project.project.form.inherit</field>
121             <field name="model">project.project</field>
122             <field name="type">form</field>
123             <field name="inherit_id" ref="project.edit_project"/>
124             <field eval="18" name="priority"/>
125             <field name="arch" type="xml">
126                 <xpath expr='//page[@name="team"]' position='after'>
127                     <page string="Contract Data">
128                         <group colspan="2" col= "2" class="oe_form_group_label_border">
129                             <separator colspan="2" string="Validity"/>
130                             <field name="date_start"/>
131                             <field name="date"/>
132                         </group>
133                         <group colspan="2" col= "2" class="oe_form_group_label_border">
134                             <separator colspan="2" string="Invoice Rate"/>
135                             <field name="pricelist_id" attrs="{'invisible': ['|',('invoice_on_timesheets','=',0),('charge_expenses','=',0)]}"/>
136                             <field name="to_invoice" widget="selection" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>
137                         </group> 
138                         <group col="6" colspan="2" class="oe_form_group_label_border">
139                             <field name="quantity_max"/><field name="company_uom_id" nolabel="1" readonly="1"/><field name="remaining_hours" string="/ Remaining"/>
140                         </group>
141                         <separator colspan="4" string="Invoicing"/>
142                         <group col="1" colspan="4">
143                             <table border="0">
144                                 <tr>
145                                     <th class="oe_th_137px" height="20px"></th>
146                                     <th width="10px"></th>
147                                     <th class="oe_th_110px">Est.Tot</th>
148                                     <th class="oe_th_110px">Invoiced</th>
149                                     <th class="oe_th_110px">Remaining</th>
150                                     <th class="oe_th_110px">Ready To Invoice</th>
151                                     <th width="10px"></th>
152                                     <th class="oe_th_150px"></th>
153                                     <th class="oe_th_150px"></th>
154                                 </tr>
155                                 <tr>
156                                     <th class="oe_border_right">Fix Price Invoices</th>
157                                     <td><field name="fix_price_invoices" nolabel="1"/></td>
158                                     <td class="oe_amount_center oe_th_110px"><field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
159                                     <td class="oe_amount_center oe_th_110px"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
160                                     <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
161                                     <td class="oe_amount_center oe_th_110px"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
162                                     <td width="10px"></td>
163                                     <td class="oe_th_150px"><button class= "oe_btn_width" name="%(action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
164                                     <td class="oe_th_150px"><button class= "oe_btn_width" name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
165                                 </tr>
166                                 <tr>
167                                     <th class="oe_border_right">Inv. On Timesheets</th>
168                                     <td><field name="invoice_on_timesheets" nolabel="1"/></td>
169                                     <td class="oe_amount_center oe_th_110px"><field name="quantity_max" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
170                                     <td class="oe_amount_center oe_th_110px"><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
171                                     <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
172                                     <td class="oe_amount_center oe_th_110px"><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
173                                     <td width="10px"></td>
174                                     <td class="oe_th_150px"><button class= "oe_btn_width" name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
175                                     <td class="oe_th_150px"><button class= "oe_btn_width" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
176                                 </tr>
177                                 <tr>
178                                     <th class="oe_border_right">Charge Expenses</th>
179                                     <td><field name="charge_expenses" nolabel="1"/></td>
180                                     <td class="oe_amount_center oe_th_110px"><field name="expense_max" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
181                                     <td class="oe_amount_center oe_th_110px"><field name="expense_invoiced" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
182                                     <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_expense" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
183                                     <td class="oe_amount_center oe_th_110px"><field name="expense_to_invoice" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
184                                     <td width="10px"></td>
185                                     <td class="oe_th_150px"><button class= "oe_btn_width" name="open_hr_expense" string="Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
186                                     <td class="oe_th_150px"><button class= "oe_btn_width" name="hr_to_invoiced_expense" string="Invoice Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
187                                 </tr>
188                                 <tr>
189                                     <th class="oe_border_right">Total</th>
190                                     <td width="10px"></td>
191                                     <td class="oe_amount_center oe_th_110px oe_border_top"><field name="est_total" nolabel="1"/></td>
192                                     <td class="oe_amount_center oe_th_110px oe_border_top"><field name="invoiced_total" nolabel="1"/></td>
193                                     <td class="oe_amount_center oe_th_110px oe_border_right oe_border_top"><field name="remaining_total" nolabel="1"/></td>
194                                     <td class="oe_amount_center oe_th_110px oe_border_top"><field name="toinvoice_total" nolabel="1"/></td>
195                                 </tr>
196                             </table>
197                         </group>
198                     <separator string="Terms and Condition" colspan="4"/>
199                     <field colspan="4" name="description" nolabel="1"/>
200                     </page>
201                 </xpath>
202             </field>
203         </record>
204
205         <!-- Add information on Account analytic list for the project management -->
206         <record id="view_account_analytic_account_tree_c2c_2" model="ir.ui.view">
207             <field name="name">account.analytic.account.tree</field>
208             <field name="model">account.analytic.account</field>
209             <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
210             <field name="type">tree</field>
211             <field name="arch" type="xml">
212                 <field name="quantity" position="replace">
213                     <field name="hours_quantity"/>
214                     <field name="hours_qtt_non_invoiced"/>
215                     <field name="remaining_hours"/>
216                     <field name="quantity_max"/>
217                 </field>
218             </field>
219         </record>
220
221         <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
222             <field name="name">account.analytic.account.tree</field>
223             <field name="model">account.analytic.account</field>
224             <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
225             <field name="type">tree</field>
226             <field name="arch" type="xml">
227                 <field name="date" position="before">
228                     <field name="last_invoice_date"/>
229                     <field name="ca_to_invoice"/>
230                 </field>
231             </field>
232         </record>
233         
234         <record id="template_of_contract_action" model="ir.actions.act_window">
235             <field name="name">Template Of Contract</field>
236             <field name="type">ir.actions.act_window</field>
237             <field name="res_model">account.analytic.account</field>
238             <field name="view_type">form</field>
239             <field name="view_mode">tree,form</field>
240             <field name="domain">[('type','=','template')]</field>
241             <field name="context">{'search_default_type':'template','default_type' : 'template'}</field>
242         </record>
243         <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config" />
244     </data>
245 </openerp>