[MERGE]merge with parent branch
authorSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Tue, 29 May 2012 08:17:56 +0000 (13:47 +0530)
committerSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Tue, 29 May 2012 08:17:56 +0000 (13:47 +0530)
bzr revid: sgo@tinyerp.com-20120529081756-l1bkznybq8ulajxc

addons/account_analytic_analysis/__openerp__.py
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 [new file with mode: 0644]

index 4f25ece..0a8fbb1 100644 (file)
@@ -44,6 +44,9 @@ user-wise as well as month wise.
                     "account_analytic_analysis_cron.xml",
                     ],
     'demo_xml': [],
+    "css" : [
+             "static/src/css/account_analytic.css",
+             ],
     'installable': True,
     'auto_install': False,
     'certificate': '0042927202589',
index 405a5f1..c06f161 100644 (file)
@@ -379,9 +379,15 @@ class account_analytic_account(osv.osv):
         'real_margin_rate': fields.function(_real_margin_rate_calc, type='float', string='Real Margin Rate (%)',
             help="Computes using the formula: (Real Margin / Total Costs) * 100.",
             digits_compute=dp.get_precision('Account')),
+        'so_visible' : fields.boolean('sale order line visible'),
+        'timsheet_visible' : fields.boolean("On timesheet"),
+        'expense_visible' : fields.boolean('expense line visible'),
         'month_ids': fields.function(_analysis_all, multi='analytic_analysis', type='many2many', relation='account_analytic_analysis.summary.month', string='Month'),
         'user_ids': fields.function(_analysis_all, multi='analytic_analysis', type="many2many", relation='account_analytic_analysis.summary.user', string='User'),
         'template_id':fields.many2one('account.analytic.account', 'Template Of Contract'),
+        'fix_exp_max' : fields.float('Max. amt'),
+        'timesheet_max': fields.float('max_timesheet'),
+        'expense_max': fields.float('expenses'),
     }
     def on_change_template(self, cr, uid, id, template_id):
         if not template_id:
index 0a84bff..b1baa35 100644 (file)
                <xpath expr='//field[@name="parent_id"]' 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='//separator[@name="description"]' position='before'>
-                   <group colspan="4" class="oe_form_group_label_border"> 
-                       <field name="pricelist_id" />
-                       <field name="to_invoice" widget="selection" />
-                   </group>
-                </xpath>
                 <xpath expr='//group[@name="project"]' position="after">
                     <group col="6" colspan="3" 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='//separator[@name="description"]' position='before'>
+                    <separator colspan="4" string="Invoicing" name="invoicing"/>
+                    <group colspan="4" name="contract_lines" class="oe_form_group_label_border">
+                        <table name="contract_data">
+                            <tr name="title" >
+                                <th ><div class="oe_field_label" ></div></th>
+                                <td><div></div></td>
+                                <th ><div class="oe_float_field_view" >Total Cost</div></th>
+                                <th ><div class="oe_field_view" >Invoiced</div></th>
+                                <th ><div class="oe_field_view" >Remaining</div></th>
+                                <th ><div class="oe_float_field_view" >Ready to Invoice</div></th>
+                            </tr>
+                            <tr>
+                                <th><div class="oe_field_label">Fix price Invoices</div></th>
+                                <td><div><field name="so_visible" nolabel="1"/></div></td>
+                                <td><div class="oe_float_field_view"><field name="fix_exp_max" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
+                                <td><div class="oe_field_view"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
+                                <td><div class="oe_field_view"></div></td>
+                                <td><div class="oe_float_field_view"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
+                                <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>
+                                <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>
+                                               </tr>
+                            <tr>
+                               <th><div class="oe_field_label">Invoice on timesheet</div></th>
+                               <td><div><field name="timsheet_visible" nolabel="1"/></div></td>
+                               <td><div class="oe_float_field_view" ><field name="timesheet_max" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
+                               <td><div class="oe_field_view" ><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
+                               <td><div class="oe_field_view" ></div></td>
+                               <td><div class="oe_float_field_view" ><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
+                               <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>
+                               <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>
+                           </tr>
+                            <tr>
+                                <th><div class="oe_field_label" >Charge Expenses</div></th>
+                                <td><div><field name="expense_visible" nolabel="1"/></div></td>
+                                <td><div class="oe_float_field_view" ><field name="expense_max" nolabel="1" attrs="{'invisible': [('expense_visible','=',0)]}"/></div></td>
+                                <td><div class="oe_field_view" ></div></td>
+                                <td><div class="oe_field_view" ></div></td>
+                                <td><div class="oe_float_field_view"></div></td>
+                            </tr>
+                            <!-- <tr name="total">
+                                <th><div class="oe_field_label" >Total</div></th>
+                                <td><div></div></td>
+                                <td><div class="oe_totals" ><field name="total_max" nolabel="1" /><field name="currency_symbol" nolabel="1" readonly="True"/></div></td>
+                                <td><div class="oe_totals_view" ><field name="total_invoiced" nolabel="1" /><field name="currency_symbol" nolabel="1" readonly="True"/></div></td>
+                                <td><div class="oe_totals_view" ><field name="total_remaining" nolabel="1" /></div></td>
+                                <td><div class="oe_totals" ><field name="total_toinvoice" nolabel="1" ></field></div></td>
+                            </tr> -->
+                        </table>
+                    </group>
+                       <group colspan="4" class="oe_form_group_label_border"> 
+                               <field name="pricelist_id" />
+                               <field name="to_invoice" widget="selection" />
+                       </group>
+                </xpath>
                 <!-- <notebook position="inside">
                     <page string="Invoice Analysis">
                         <separator colspan="4" string="Work Done Stats"/>
diff --git a/addons/account_analytic_analysis/static/src/css/account_analytic.css b/addons/account_analytic_analysis/static/src/css/account_analytic.css
new file mode 100644 (file)
index 0000000..b9a043e
--- /dev/null
@@ -0,0 +1,34 @@
+.oe_field_view {
+    width: 80px;
+    text-align: center;
+}
+.oe_float_field_view {
+    width: 110px;
+    text-align: center;
+}
+.oe_title_button_left {
+    min-width: 140px;
+    text-align: left;
+    margin-left: 5px !important;
+}
+
+.oe_title_button_right {
+    min-width: 110px;
+    text-align: right;
+    margin-left: 55px !important;
+}
+
+.oe_field_label {
+    text-align: left;
+}
+
+.oe_totals {
+    width: 110px;
+    text-align: center;
+    border-top:  groove;
+}
+.oe_totals_view {
+    width: 80px;
+    text-align: center;
+    border-top:  groove;
+}
\ No newline at end of file