[IMP]open on btn sale timesheet line and improve sale view

bzr revid: sgo@tinyerp.com-20120615121700-6talnwo1d1wyn5j8
This commit is contained in:
Sanjay Gohel (Open ERP) 2012-06-15 17:47:00 +05:30
parent 32a02b3565
commit 0759ac7126
4 changed files with 40 additions and 5 deletions

View File

@ -437,6 +437,26 @@ class account_analytic_account(osv.osv):
'remaining_total' : fields.function(_sum_of_fields, type="float",multi="sum_of_all"),
'toinvoice_total' : fields.function(_sum_of_fields, type="float",multi="sum_of_all"),
}
def open_sale_order_lines(self,cr,uid,ids,context=None):
if context is None:
context = {}
account = self.browse(cr,uid,ids[0],context)
sale_pool = self.pool.get('sale.order')
sale_ids = sale_pool.search(cr,uid,[('project_id','in',ids),('partner_id','=',account.partner_id.id)])
sale_context = {}
domain = [('order_id','in',sale_ids)]
sale_context = {'search_default_invoiced':False,'default_invoiced':False}
return {
'type': 'ir.actions.act_window',
'name': _('Sale Order Lines'),
'view_type': 'form',
'view_mode': 'tree,form',
'context':sale_context,
'domain' : domain,
'res_model': 'sale.order.line',
'nodestroy': True,
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
if not template_id:

View File

@ -8,7 +8,7 @@
<act_window
id="action_sales_order"
name="Sales Order Lines"
name="Sales Order"
res_model="sale.order"
src_model="account.analytic.account"
/>
@ -62,7 +62,7 @@
<field class="oe_form_inline" name="ca_to_invoice" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
</td><td>
<button name="%(action_sales_order)d" string="All Sales" type="action" context="{'default_partner_id': [partner_id], 'search_default_partner_id': [partner_id]}" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
<button 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','=',False)]}"/></td>
<button name="open_sale_order_lines" string="Lines To Invoice" type="object" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/></td>
</tr><tr attrs="{'invisible':[('use_timesheets','=',False)]}">
<td>
<label for="invoice_on_timesheets"/>
@ -77,8 +77,8 @@
</td><td>
<field class="oe_form_inline" name="hours_qtt_non_invoiced" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
</td><td>
<button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="All Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
<button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Timesheets to Invoice" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
<button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="All Timesheets" type="action" context="{'default_account_id': active_id,'search_default_account_id': active_id}" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
<button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Timesheets to Invoice" type="action" context="{'default_account_id': active_id,'search_default_account_id': active_id}" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
</td>
</tr><tr>
<th>

View File

@ -12,6 +12,21 @@
<field name="product_id" ref="product.product_consultant"/>
<field name="journal_id" ref="analytic_journal"/>
</record>
<record id="account.analytic_administratif" model="account.analytic.account">
<field name="use_timesheets">True</field>
</record>
<record id="account.analytic_partners" model="account.analytic.account">
<field name="type">contract</field>
<field name="use_timesheets">True</field>
</record>
<record id="account.analytic_customers" model="account.analytic.account">
<field name="type">contract</field>
<field name="use_timesheets">True</field>
</record>
<record id="account.analytic_support_internal" model="account.analytic.account">
<field name="type">contract</field>
<field name="use_timesheets">True</field>
</record>
<record id="working_hours_requirements" model="hr.analytic.timesheet">
<field name="name">Requirements analysis and specification</field>

View File

@ -137,7 +137,7 @@
<field domain="[('parent_id','=',partner_id)]" name="partner_invoice_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
<field domain="[('parent_id','=',partner_id)]" name="partner_shipping_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
<field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
<field name="project_id" context="{'partner_id':partner_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="sale.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
<field name="project_id" context="{'partner_id':partner_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/>
</group><group>
<field name="date_order"/>
<field name="shop_id" on_change="onchange_shop_id(shop_id)" widget="selection" groups="stock.group_locations"/>