[FIX] crm: Check if there is a model for the log of the crm.case

bzr revid: stephane@openerp.com-20100511154023-joyuanu159l6bw00
This commit is contained in:
Stephane Wirtel 2010-05-11 17:40:23 +02:00
parent 41ef3a09e8
commit 5365ed0efc
1 changed files with 5 additions and 0 deletions

View File

@ -202,6 +202,11 @@ class crm_send_new_email(osv.osv_memory):
res = {}
for hist in hist_obj.browse(cr, uid, res_ids):
model = hist.log_id.model_id.model
# In the case where the crm.case does not exist in the database
if not model:
return {}
model_pool = self.pool.get(model)
case = model_pool.browse(cr, uid, hist.log_id.res_id)
if 'email_to' in fields: