[FIX] sale_crm: wizard crm_make_sale crash if partner_id not sent on the opp.
Because defaults get function of partner_id of wizard read the partner_id of the opp and return the first item of the tuple, but if there isnt a partner on the opp, the read return a false for this field, not a tuple. No return the first item of the tuple if the partner_id is set, else False bzr revid: dle@openerp.com-20131204133633-t7wfbnipv3jtss82
This commit is contained in:
parent
379dc8bf98
commit
c0c971b87a
|
@ -47,7 +47,7 @@ class crm_make_sale(osv.osv_memory):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
lead = lead_obj.read(cr, uid, active_id, ['partner_id'], context=context)
|
lead = lead_obj.read(cr, uid, active_id, ['partner_id'], context=context)
|
||||||
return lead['partner_id'][0]
|
return lead['partner_id'][0] if lead['partner_id'] else False
|
||||||
|
|
||||||
def view_init(self, cr, uid, fields_list, context=None):
|
def view_init(self, cr, uid, fields_list, context=None):
|
||||||
return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)
|
return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)
|
||||||
|
|
Loading…
Reference in New Issue