b1baa35e431de848d15293fd2fc922aeab2eaee8
[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
32         <record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
33             <field name="name">account.analytic.account.invoice.form.inherit</field>
34             <field name="model">account.analytic.account</field>
35             <field name="type">form</field>
36             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
37             <field eval="18" name="priority"/>
38             <field name="arch" type="xml">
39                 <xpath expr='//field[@name="parent_id"]' position='after'>
40                     <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'}"/>
41                 </xpath>
42                 <xpath expr='//group[@name="project"]' position="after">
43                     <group col="6" colspan="3" class="oe_form_group_label_border">
44                         <field name="quantity_max"/><label string="/"/> <label string="Remaining"/> <field name="remaining_hours" nolabel="1"/>
45                     </group>
46                 </xpath>
47                 <xpath expr='//separator[@name="description"]' position='before'>
48                     <separator colspan="4" string="Invoicing" name="invoicing"/>
49                     <group colspan="4" name="contract_lines" class="oe_form_group_label_border">
50                         <table name="contract_data">
51                             <tr name="title" >
52                                 <th ><div class="oe_field_label" ></div></th>
53                                 <td><div></div></td>
54                                 <th ><div class="oe_float_field_view" >Total Cost</div></th>
55                                 <th ><div class="oe_field_view" >Invoiced</div></th>
56                                 <th ><div class="oe_field_view" >Remaining</div></th>
57                                 <th ><div class="oe_float_field_view" >Ready to Invoice</div></th>
58                             </tr>
59                             <tr>
60                                 <th><div class="oe_field_label">Fix price Invoices</div></th>
61                                 <td><div><field name="so_visible" nolabel="1"/></div></td>
62                                 <td><div class="oe_float_field_view"><field name="fix_exp_max" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
63                                 <td><div class="oe_field_view"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
64                                 <td><div class="oe_field_view"></div></td>
65                                 <td><div class="oe_float_field_view"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
66                                 <td><button class="oe_title_button_right" name="%(sale.action_order_form)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('so_visible','=',0)]}"/></td>
67                                 <td><button class="oe_title_button_left" 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': [('so_visible','=',0)]}"/></td>
68                                                 </tr>
69                             <tr>
70                                <th><div class="oe_field_label">Invoice on timesheet</div></th>
71                                <td><div><field name="timsheet_visible" nolabel="1"/></div></td>
72                                <td><div class="oe_float_field_view" ><field name="timesheet_max" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
73                                <td><div class="oe_field_view" ><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
74                                <td><div class="oe_field_view" ></div></td>
75                                <td><div class="oe_float_field_view" ><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
76                                <td><button class="oe_title_button_right" name="%(hr_timesheet_invoice.act_account_analytic_account_2_report_timehsheet_account)d" string="Timesheets" type="action" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></td>
77                                <td><button class="oe_title_button_left" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></td>
78                            </tr>
79                             <tr>
80                                 <th><div class="oe_field_label" >Charge Expenses</div></th>
81                                 <td><div><field name="expense_visible" nolabel="1"/></div></td>
82                                 <td><div class="oe_float_field_view" ><field name="expense_max" nolabel="1" attrs="{'invisible': [('expense_visible','=',0)]}"/></div></td>
83                                 <td><div class="oe_field_view" ></div></td>
84                                 <td><div class="oe_field_view" ></div></td>
85                                 <td><div class="oe_float_field_view"></div></td>
86                             </tr>
87                             <!-- <tr name="total">
88                                 <th><div class="oe_field_label" >Total</div></th>
89                                 <td><div></div></td>
90                                 <td><div class="oe_totals" ><field name="total_max" nolabel="1" /><field name="currency_symbol" nolabel="1" readonly="True"/></div></td>
91                                 <td><div class="oe_totals_view" ><field name="total_invoiced" nolabel="1" /><field name="currency_symbol" nolabel="1" readonly="True"/></div></td>
92                                 <td><div class="oe_totals_view" ><field name="total_remaining" nolabel="1" /></div></td>
93                                 <td><div class="oe_totals" ><field name="total_toinvoice" nolabel="1" ></field></div></td>
94                             </tr> -->
95                         </table>
96                     </group>
97                         <group colspan="4" class="oe_form_group_label_border"> 
98                                 <field name="pricelist_id" />
99                                 <field name="to_invoice" widget="selection" />
100                         </group>
101                 </xpath>
102                 <!-- <notebook position="inside">
103                     <page string="Invoice Analysis">
104                         <separator colspan="4" string="Work Done Stats"/>
105
106                         <field name="total_cost"/>
107                         <field name="remaining_ca"/>
108                         <field name="ca_invoiced"/>
109                         <field name="ca_theorical"/>
110                         <newline/>
111                         <field name="hours_quantity"/>
112                         <field name="hours_qtt_invoiced"/>
113                         <field name="remaining_hours"/>
114                         <newline/>
115                         <separator colspan="4" string="Analysis Stats"/>
116
117                         <field name="revenue_per_hour"/>
118                         <field name="real_margin"/>
119                         <field name="real_margin_rate"/>
120                         <field name="theorical_margin"/>
121                         <separator colspan="4" string="Key Dates"/>
122
123                         <field name="last_invoice_date"/>
124                         <field name="last_worked_invoiced_date"/>
125                         <field name="last_worked_date"/>
126                     </page>
127                     <page string="Stats by month">
128                         <field colspan="4" name="month_ids" nolabel="1">
129                             <tree string="Month">
130                                 <field name="month"/>
131                                 <field name="unit_amount" widget="float_time"/>
132                             </tree>
133                         </field>
134                     </page>
135                     <page string="Stats by user">
136                         <field colspan="4" name="user_ids" nolabel="1">
137                             <tree string="Users">
138                                 <field name="user"/>
139                                 <field name="unit_amount" widget="float_time"/>
140                             </tree>
141                         </field>
142                     </page>
143                 </notebook> -->
144
145             </field>
146         </record>
147
148         <!-- Add information on Account analytic list for the project management -->
149         <record id="view_account_analytic_account_tree_c2c_2" model="ir.ui.view">
150             <field name="name">account.analytic.account.tree</field>
151             <field name="model">account.analytic.account</field>
152             <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
153             <field name="type">tree</field>
154             <field name="arch" type="xml">
155                 <field name="quantity" position="replace">
156                     <field name="hours_quantity"/>
157                     <field name="hours_qtt_non_invoiced"/>
158                     <field name="remaining_hours"/>
159                     <field name="quantity_max"/>
160                 </field>
161             </field>
162         </record>
163
164         <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
165             <field name="name">account.analytic.account.tree</field>
166             <field name="model">account.analytic.account</field>
167             <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
168             <field name="type">tree</field>
169             <field name="arch" type="xml">
170                 <field name="date" position="before">
171                     <field name="last_invoice_date"/>
172                     <field name="ca_to_invoice"/>
173                 </field>
174             </field>
175         </record>
176         
177         <record id="template_of_contract_action" model="ir.actions.act_window">
178             <field name="name">Template Of Contract</field>
179             <field name="type">ir.actions.act_window</field>
180             <field name="res_model">account.analytic.account</field>
181             <field name="view_type">form</field>
182             <field name="view_mode">tree,form</field>
183             <field name="domain">[('type','=','template')]</field>
184             <field name="context">{'search_default_type':'template','default_type' : 'template'}</field>
185         </record>
186         <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config" />
187     </data>
188 </openerp>