[FIX] sale: overwrite _make_invoice and get section_id in sale_crm module
bzr revid: chm@openerp.com-20130522104858-zlhe453zu9r41lqx
This commit is contained in:
parent
aed639f6d1
commit
35cd85b0ba
|
@ -400,10 +400,6 @@ class sale_order(osv.osv):
|
|||
def _make_invoice(self, cr, uid, order, lines, context=None):
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
obj_invoice_line = self.pool.get('account.invoice.line')
|
||||
if context is None:
|
||||
context = {}
|
||||
if order.section_id:
|
||||
context.update({'default_section_id': order.section_id.id})
|
||||
invoiced_sale_line_ids = self.pool.get('sale.order.line').search(cr, uid, [('order_id', '=', order.id), ('invoiced', '=', True)], context=context)
|
||||
from_line_invoice_ids = []
|
||||
for invoiced_sale_line_id in self.pool.get('sale.order.line').browse(cr, uid, invoiced_sale_line_ids, context=context):
|
||||
|
|
|
@ -39,6 +39,11 @@ class sale_order(osv.osv):
|
|||
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
|
||||
}
|
||||
|
||||
def _make_invoice(self, cr, uid, order, lines, context=None):
|
||||
if order.section_id:
|
||||
context = dict(context or {}, default_section_id= order.section_id.id)
|
||||
return super(sale_order, self)._make_invoice(cr, uid, order, lines, context=context)
|
||||
|
||||
|
||||
class crm_case_section(osv.osv):
|
||||
_inherit = 'crm.case.section'
|
||||
|
|
Loading…
Reference in New Issue