[ADD] analytic_contract_hr_expense: split of features of account_analytic_analysis...
[odoo/odoo.git] / addons / account_analytic_analysis / account_analytic_analysis_view.xml
index 6f30c05..bf45121 100644 (file)
@@ -1,71 +1,81 @@
 <?xml version="1.0" encoding="utf-8"?>
-<terp>
+<openerp>
     <data>
 
         <!--
-        Analytic Account form 
-
-        Remove information on Account data => because they move on analysis sheet
-        create a page with invoicing informations
+        Analytic Account form
         -->
+
+
+        <act_window
+            id="action_sales_order_line"
+            name="Sales Order Lines"
+            res_model="sale.order.line"
+            src_model="account.analytic.account"
+            />
+            
         <record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
-            <field name="name">account.analytic.account.invoice.form.inherit</field> 
-            <field name="model">account.analytic.account</field> 
-            <field name="type">form</field> 
-            <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
+            <field name="name">account.analytic.account.invoice.form.inherit</field>
+            <field name="model">account.analytic.account</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
             <field eval="18" name="priority"/>
             <field name="arch" type="xml">
-                <form>
-                    <notebook position="inside">
-                        <page string="Analysis summary">
-                            <separator colspan="4" string="Work done stats"/>
-
-                            <field name="total_cost"/>
-                            <field name="remaining_ca"/>
-                            <field name="ca_invoiced"/>
-                            <field name="ca_theorical"/>
-                            <newline/>
-                            <!-- <field name="old"/> -->
-                            <field name="hours_quantity"/>
-                            <field name="hours_qtt_invoiced"/>
-                            <field name="remaining_hours"/>
-                            <newline/>
-                            <separator colspan="4" string="Analysis stats"/>
-
-                            <field name="revenue_per_hour"/>
-                            <field name="real_margin"/>
-                            <field name="theorical_margin"/>
-                            <field name="real_margin_rate"/>
-                            <separator colspan="4" string="Key dates"/>
-
-                            <field name="last_invoice_date"/>
-
-                            <field name="last_worked_invoiced_date" select="2"/>
-                            <field name="last_worked_date"/>
-                            <separator colspan="4" string="To be invoiced"/>
-                            <field name="hours_qtt_non_invoiced"/>
-                            <field name="ca_to_invoice" select="2"/>
-
-                        </page>
-                        <page string="Stats by month">  
-                            <field colspan="4" name="month_ids" nolabel="1">
-                                <tree string="Month">
-                                    <field name="month"/>
-                                    <field name="unit_amount" widget="float_time"/>
-                                </tree>
-                            </field>
-                        </page>
-                        <page string="Stats by user"> 
-                            <field colspan="4" name="user_ids" nolabel="1">
-                                <tree string="Users">
-                                    <field name="user"/>
-                                    <field name="unit_amount" widget="float_time"/>
-                                </tree>
-                            </field>
-                        </page>
-                    </notebook>
-
-                </form>
+                <xpath expr='//field[@name="type"]' position='after'>
+                    <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'}"/>
+                </xpath>
+                <xpath expr='//field[@name="date"]' position="after">
+                    <group col="6" colspan="2" class="oe_form_group_label_border">
+                        <field name="quantity_max"/><label string="/"/> <label string="Remaining"/> <field name="remaining_hours" nolabel="1"/>
+                    </group>
+                </xpath>
+                <xpath expr='//field[@name="pricelist_id"]' position='before'>
+                    <separator colspan="4" string="Invoicing" name="invoicing"/>
+                    <table border="0" colspan="4">
+                        <tr>
+                           <th class="oe_th_160px" height="20px"></th>
+                           <th width="10px"></th>
+                           <th class="oe_th_110px">Est.Tot</th>
+                           <th class="oe_th_110px">Invoiced</th>
+                           <th class="oe_th_110px">Remaining</th>
+                           <th class="oe_th_110px">Ready To Invoice</th>
+                           <th width="10px"></th>
+                           <th></th>
+                           <th></th>
+                        </tr>
+                        <tr>
+                           <th class="oe_border_right">Fix Price Invoices</th>
+                           <td><field name="fix_price_invoices" nolabel="1"/></td>
+                           <td><field class="oe_th_110px" name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
+                           <td class="oe_th_110px"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
+                           <td class="oe_th_110px oe_border_right"><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
+                           <td class="oe_th_110px"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
+                           <td width="10px"></td>
+                           <td><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>
+                           <td><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>
+                        </tr>
+                        <tr>
+                           <th class="oe_border_right">Invoice On Timesheets</th>
+                           <td><field name="invoice_on_timesheets" nolabel="1"/></td>
+                           <td><field class="oe_th_110px" name="hours_qtt_est" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
+                           <td class="oe_th_110px"><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
+                           <td class="oe_th_110px oe_border_right"><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
+                           <td class="oe_th_110px"><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
+                           <td width="10px"></td>
+                           <td><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>
+                           <td><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>
+                        </tr>
+                        <div name="end_of_tabl_hook"/>
+                        <tr>
+                           <th class="oe_border_right">Total</th>
+                           <td width="10px"></td>
+                           <td class="oe_th_110px oe_border_top"><field name="est_total" nolabel="1"/></td>
+                           <td class="oe_th_110px oe_border_top"><field name="invoiced_total" nolabel="1"/></td>
+                           <td class="oe_th_110px oe_border_right oe_border_top"><field name="remaining_total" nolabel="1"/></td>
+                           <td class="oe_th_110px oe_border_top"><field name="toinvoice_total" nolabel="1"/></td>
+                        </tr>
+                    </table>
+                </xpath>
             </field>
         </record>
 
                     <field name="hours_quantity"/>
                     <field name="hours_qtt_non_invoiced"/>
                     <field name="remaining_hours"/>
+                    <field name="quantity_max"/>
                 </field>
             </field>
         </record>
-        <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view"> 
-            <field name="name">account.analytic.account.tree</field> 
-            <field name="model">account.analytic.account</field> 
-            <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
-
-            <field name="type">tree</field> 
-            <field name="arch" type="xml"> 
-                <field name="date" position="before"> 
-                    <field name="last_invoice_date"/>
-
-                    <field name="ca_to_invoice"/>
-                </field>
-
-            </field>
-
-        </record>
 
-        <record id="view_account_analytic_simplified" model="ir.ui.view">
-            <field name="name">account.analytic.account.simplified.tree</field>
+        <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
+            <field name="name">account.analytic.account.tree</field>
             <field name="model">account.analytic.account</field>
+            <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
             <field name="type">tree</field>
-            <field eval="20" name="priority"/>
             <field name="arch" type="xml">
-                <tree string="Analytic accounts">
-                    <field name="code"/>
-                    <field name="complete_name"/>
-                    <field name="hours_qtt_non_invoiced"/>
-                    <field name="remaining_hours"/>
-                    <field name="ca_to_invoice"/>
+                <field name="date" position="before">
                     <field name="last_invoice_date"/>
-
-                </tree>
+                    <field name="ca_to_invoice"/>
+                </field>
             </field>
         </record>
-
+        
+        <record id="template_of_contract_action" model="ir.actions.act_window">
+            <field name="name">Template of Contract</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">account.analytic.account</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="domain">[('type','=','template')]</field>
+            <field name="context">{'search_default_type':'template','default_type' : 'template'}</field>
+        </record>
+        <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config" />
     </data>
-</terp>
\ No newline at end of file
+</openerp>