[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:
Denis Ledoux 2013-12-04 14:36:33 +01:00
parent 379dc8bf98
commit c0c971b87a
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class crm_make_sale(osv.osv_memory):
return False
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):
return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)