[FIX]: crm_partner_assign: Fixed a problem when there is no partner found

bzr revid: rpa@tinyerp.com-20101008105641-lk93kad5hbf3hrx0
This commit is contained in:
rpa (Open ERP) 2010-10-08 16:26:41 +05:30
parent 9e33cddedc
commit 0aa7ad9d0b
1 changed files with 2 additions and 1 deletions

View File

@ -171,7 +171,8 @@ class crm_lead(osv.osv):
AND partner_weight > 0) AS d
ORDER BY distance LIMIT 1""", (result[1],result[0]))
res = cr.dictfetchone()
part_ids.append(res['id'])
if res:
part_ids.append(res['id'])
total = 0
toassign = []