[IMP]:contract,analytic_project,analytic_hr_expense: improve whole contract view...
authorSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Thu, 14 Jun 2012 10:07:53 +0000 (15:37 +0530)
committerSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Thu, 14 Jun 2012 10:07:53 +0000 (15:37 +0530)
bzr revid: sgo@tinyerp.com-20120614100753-giewe8jay1xx04wb

addons/account_analytic_analysis/account_analytic_analysis.py
addons/account_analytic_analysis/account_analytic_analysis_view.xml
addons/account_analytic_analysis/static/src/css/account_analytic.css
addons/analytic/analytic_view.xml
addons/analytic_contract_hr_expense/analytic_contract_hr_expense_view.xml
addons/analytic_contract_project/analytic_contract_project_view.xml
addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml

index 9c38877..1661f1c 100644 (file)
@@ -387,7 +387,7 @@ class account_analytic_account(osv.osv):
             digits_compute=dp.get_precision('Account')),
         'ca_to_invoice': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Uninvoiced Amount',
             help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs.",
-            digits_compute=dp.get_precision('Account'),store="True"),
+            digits_compute=dp.get_precision('Account')),
         'ca_theorical': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Theoretical Revenue',
             help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.",
             digits_compute=dp.get_precision('Account')),
index 91a312c..d724913 100644 (file)
                         <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'>
+                <xpath expr='//group[@name="toinvoice"]' 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_90px">Est.Tot</th>
-                           <th class="oe_th_90px">Invoiced</th>
-                           <th class="oe_th_90px">Remaining</th>
-                           <th class="oe_th_110px">Ready To Invoice</th>
-                           <th width="10px"></th>
-                           <th></th>
-                           <th></th>
-                        </tr>
-                        <tr>
-                           <th class="oe_th_160px oe_border_right">Fix Price Invoices</th>
-                           <td><field width="10px" name="fix_price_invoices" nolabel="1"/></td>
-                           <group attrs="{'invisible': [('fix_price_invoices','=',0)]}">
-                           <td><field class="oe_th_90px" name="amount_max" nolabel="1" /></td>
-                           <td ><field class="oe_th_90px" name="ca_invoiced" nolabel="1" /></td>
-                           <td ><field class="oe_th_90px oe_border_right" name="remaining_ca" nolabel="1" /></td>
-                           <td ><field class="oe_th_110px" name="ca_to_invoice" nolabel="1" /></td>
-                           <td width="10px"></td>
-                           <td><button icon="terp-check" class= "oe_btn_width_120px" 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 icon="terp-dolar_ok!" 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>
-                           </group>
-                        </tr>
-                        <tr>
-                           <th class="oe_th_160px oe_border_right">Invoice On Timesheets</th>
-                           <td><field width="10px" name="invoice_on_timesheets" nolabel="1"/></td>
-                           <td><field class="oe_th_90px" name="hours_qtt_est" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
-                           <td ><field class="oe_th_90px" name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
-                           <td ><field class="oe_th_90px oe_border_right" name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
-                           <td ><field class="oe_th_110px" name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
-                           <td width="10px"></td>
-                           <td><button icon="terp-go-week" class= "oe_btn_width_120px" name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
-                           <td><button icon="terp-dolar" 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_th_160px oe_border_right">Total</th>
-                           <td width="10px"></td>
-                           <td ><field class="oe_th_90px oe_border_top" name="est_total" nolabel="1"/></td>
-                           <td ><field class="oe_th_90px oe_border_top" name="invoiced_total" nolabel="1"/></td>
-                           <td ><field class="oe_th_90px oe_border_right oe_border_top" name="remaining_total" nolabel="1"/></td>
-                           <td ><field class="oe_th_110px oe_border_top" name="toinvoice_total" nolabel="1"/></td>
-                        </tr>
-                    </table>
-                </xpath>
+                    <group colspan="4" col="6">
+                        <!-- header -->
+                        <div class="oe_field_label" colspan="2"/>
+                        <group colspan="4" col="6">
+                            <div class="oe_field_label_bold">Est.Tot</div>
+                            <div class="oe_field_label_bold">Invoiced</div>
+                            <div class="oe_field_label_bold">Remaining</div>
+                            <div class="oe_field_label_bold">To Invoice</div>
+                            <div class="oe_btn_width_small"/>
+                            <div class="oe_btn_width"/>
+                        </group>
+                        
+                        <!-- center -->
+                        
+                        <field class="oe_field_label" name="fix_price_invoices" />
+                        <group colspan="4" col="6" attrs="{'invisible': [('fix_price_invoices','=',False)]}">
+                            <field class="oe_float_field" name="amount_max" nolabel="1"   />
+                            <field class="oe_float_field" name="ca_invoiced" nolabel="1"   />
+                            <field class="oe_float_field" name="remaining_ca" nolabel="1"   />
+                            <field class="oe_float_field" name="ca_to_invoice" nolabel="1"   />
+                            <div><button class="oe_btn_width_small" icon="terp-check" name="%(action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}"/></div>
+                            <div><button class="oe_btn_width" icon="terp-dolar_ok!" 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}"/></div>
+                        </group>
+                        
+                        <field class="oe_field_label" name="invoice_on_timesheets"/>
+                         <group colspan="4" col="6" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
+                            <field class="oe_float_field" name="hours_qtt_est" nolabel="1" />
+                            <field class="oe_float_field" name="hours_qtt_invoiced" nolabel="1"/>
+                            <field class="oe_float_field" name="remaining_hours" nolabel="1" />
+                            <field class="oe_float_field" name="hours_qtt_non_invoiced" nolabel="1" />
+                            <div><button class="oe_btn_width_small" icon="terp-go-week" name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="Timesheets" type="action" /></div>
+                            <div><button class="oe_btn_width" icon="terp-dolar" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action"/></div>
+                        </group>
+                        
+                        <!-- footer -->
+                        
+                        <div name="total" class="oe_field_label" style="max-width:200px;" colspan="2">Total  </div>
+                        <group colspan="4" col="6" >
+                            <field name="est_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <field name="invoiced_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <field name="remaining_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <field name="toinvoice_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <div class="oe_btn_width_small"/>
+                            <div class="oe_btn_width"/>
+                        </group>
+                      </group>
+                 </xpath>
             </field>
         </record>
 
index e4872e7..73c6599 100644 (file)
@@ -1,26 +1,27 @@
-.oe_th_90px{
-    width:90px !important;
+.oe_float_field{
+    width:80px !important;
     text-align: center !important;
     vertical-align: middle;
 }
-.oe_th_160px{
+.oe_field_label{
     width:150px;
+    font-weight:bold;
 }
 .oe_btn_width{
     width: 150px !important;
 }
-.oe_border_right{
-    border-right: 1px solid #DDD;
-    padding-left: 6px !important;
-}
 .oe_border_top{
     border-top: 1px solid #000000;
 }
-.oe_th_110px{
-    width:110px !important;
-    text-align: center !important;
+.oe_btn_width_small{
+    width: 110px !important;
+}
+.oe_td_label_to{
+    width:100px;
+}
+.oe_field_label_bold{
+    width:80px !important;
+    padding-left: 12px !important;
     vertical-align: middle;
+    font-weight:bold;
 }
-.oe_btn_width_120px{
-    width: 110px !important;
-}
\ No newline at end of file
index c63d3bd..a606209 100644 (file)
                             <field name="code"/>
                             <field name="manager_id"/>
                             <field name="company_id" on_change="on_change_company(company_id)" select="2" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
-                            <field name="type" select="2"/>
+                            <field name="type"/>
                             <field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract','template'])]}"/>
                         </group>
                         <notebook colspan="4">
-                            <page string="Contract Information" name="contract_page" col="4">
+                            <page string="Contract Information" name="contract_page">
                                 <group col="4" colspan="4">
                                     <group colspan="2" col= "2" name="contract" class="oe_form_group_label_border">
                                         <separator colspan="2" string="Validity"/>
@@ -29,8 +29,8 @@
                                     <group colspan="2" col="2" name="project" class="oe_form_group_label_border">
                                         <separator colspan="2" string="Project" name="project_sep" invisible="1"/>
                                     </group>
+                                     <group name="toinvoice" colspan="4" col="4"></group>
                                 </group>
-                                <group name="toinvoice" colspan="4" col="4"></group>
                                 <separator string="Terms and Conditions" colspan="4" name="description"/>
                                 <field colspan="4" name="description" nolabel="1"/>
                             </page>
index 27d1d86..4599635 100644 (file)
@@ -8,18 +8,16 @@
             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
             <field eval="20" name="priority"/>
             <field name="arch" type="xml">
-                <xpath expr='//div[@name="end_of_tabl_hook"]' position='before'>
-                        <tr>
-                            <th class="oe_th_160px oe_border_right">Charge Expenses</th>
-                            <td><field name="charge_expenses" nolabel="1"/></td>
-                            <td><field class="oe_th_90px" name="est_expenses" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
-                            <td class="oe_th_90px"><field name="expense_invoiced" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
-                            <td class="oe_th_90px oe_border_right"><field name="remaining_expense" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
-                            <td class="oe_th_110px"><field name="expense_to_invoice" nolabel="1" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
-                            <td width="10px"></td>
-                            <td><button icon="gtk-select-all" class= "oe_btn_width_120px" name="open_hr_expense" string="Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',0)]}"/></td>
-                            <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>
-                        </tr>
+                <xpath expr='//div[@name="total"]' position='before'>
+                        <field class="oe_field_label" name="charge_expenses"/>
+                         <group colspan="4" col="6" attrs="{'invisible': [('charge_expenses','=',False)]}">
+                            <field class="oe_float_field" name="est_expenses" nolabel="1" />
+                            <field class="oe_float_field" name="expense_invoiced" nolabel="1"/>
+                            <field class="oe_float_field" name="remaining_expense" nolabel="1" />
+                            <field class="oe_float_field" name="expense_to_invoice" nolabel="1" />
+                            <div><button class="oe_btn_width_small" icon="gtk-select-all" name="open_hr_expense" string="Expenses" type="object" /></div>
+                            <div><button class="oe_btn_width" icon="terp-dolar" name="hr_to_invoiced_expense" string="Invoice Expenses" type="object"/></div>
+                        </group>
                 </xpath>
             </field>
         </record>
index cea5957..06b5a66 100644 (file)
                                                        </group>
                                                </group>
                                                <separator colspan="4" string="Invoicing"/>
-                                               <group col="1" colspan="4">
-                                                       <table border="0">
-                                                               <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 icon="terp-check" class= "oe_btn_width" name="%(account_analytic_analysis.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 icon="terp-dolar_ok!" 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="quantity_max" 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 icon="terp-go-week" 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 icon="terp-dolar" 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>
-                                               </group>
+                                               <group colspan="4" col="6">
+                        <!-- header -->
+                        <div class="oe_field_label" colspan="2"/>
+                        <group colspan="4" col="6">
+                            <div class="oe_field_label_bold">Est.Tot</div>
+                            <div class="oe_field_label_bold">Invoiced</div>
+                            <div class="oe_field_label_bold">Remaining</div>
+                            <div class="oe_field_label_bold">To Invoice</div>
+                            <div class="oe_btn_width_small"/>
+                            <div class="oe_btn_width"/>
+                        </group>
+                        
+                        <!-- center -->
+                        
+                        <field class="oe_field_label" name="fix_price_invoices" />
+                        <group colspan="4" col="6" attrs="{'invisible': [('fix_price_invoices','=',False)]}">
+                            <field class="oe_float_field" name="amount_max" nolabel="1"   />
+                            <field class="oe_float_field" name="ca_invoiced" nolabel="1"   />
+                            <field class="oe_float_field" name="remaining_ca" nolabel="1"   />
+                            <field class="oe_float_field" name="ca_to_invoice" nolabel="1"   />
+                            <div><button class="oe_btn_width_small" icon="terp-check" name="%(account_analytic_analysis.action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}"/></div>
+                            <div><button class="oe_btn_width" icon="terp-dolar_ok!" 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}"/></div>
+                        </group>
+                        
+                        <field class="oe_field_label" name="invoice_on_timesheets"/>
+                         <group colspan="4" col="6" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
+                            <field class="oe_float_field" name="hours_qtt_est" nolabel="1" />
+                            <field class="oe_float_field" name="hours_qtt_invoiced" nolabel="1"/>
+                            <field class="oe_float_field" name="remaining_hours" nolabel="1" />
+                            <field class="oe_float_field" name="hours_qtt_non_invoiced" nolabel="1" />
+                            <div><button class="oe_btn_width_small" icon="terp-go-week" name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="Timesheets" type="action" /></div>
+                            <div><button class="oe_btn_width" icon="terp-dolar" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action"/></div>
+                        </group>
+                        
+                        <!-- footer -->
+                        
+                        <div class="oe_field_label oe_border_right" style="max-width:200px;" colspan="2">Total  </div>
+                        <group colspan="4" col="6" >
+                            <field name="est_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <field name="invoiced_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <field name="remaining_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <field name="toinvoice_total" nolabel="1" class="oe_float_field oe_border_top"/>
+                            <div class="oe_btn_width_small"/>
+                            <div class="oe_btn_width"/>
+                        </group>
+                      </group>
                                                <separator string="Terms and Conditions" colspan="4" name="description"/>
                                                <field colspan="4" name="description" nolabel="1"/>
                                        </page>
index 287dff8..3493532 100644 (file)
@@ -7,9 +7,9 @@
             <field name="type">form</field>
             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
             <field name="arch" type="xml">
-                 <xpath expr='//group[@name="toinvoice"]' position='inside'>
-                    <field name="pricelist_id" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>
-                    <field name="to_invoice" widget="selection" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>
+                <xpath expr='//group[@name="toinvoice"]' position='inside'>
+                    <field name="pricelist_id" />
+                    <field name="to_invoice" widget="selection" />
                  </xpath>
                 <xpath expr="/form/sheet" position='before'>
                     <header>