From c0c971b87ab6b753bb6b3171bbddf1815c8da62b Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 4 Dec 2013 14:36:33 +0100 Subject: [PATCH] [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 --- addons/sale_crm/wizard/crm_make_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index 316141b72b8..d44715925d9 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -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)