From fa45d444e5204e7692cca42278563b3042906cfd Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 9 Apr 2010 16:33:13 +0200 Subject: [PATCH] [FIX] crm: If there is at least resource, we take the right id bzr revid: stephane@openerp.com-20100409143313-wz6tnv234exqi42r --- addons/crm/crm_lead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 4878569da6c..546431ac7c7 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -81,7 +81,8 @@ class crm_lead(osv.osv): resource_id = False if lead.user_id: resource_ids = res_obj.search(cr, uid, [('user_id','=',lead.user_id.id)]) - resource_id = len(resource_ids) or resource_ids[0] + if len(resource_ids): + resource_id = resource_ids[0] duration = float(ans.days) if lead.section_id.resource_calendar_id: