From 8439e0be293f52e5cd8a53795017009f521c525d Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Tue, 10 Aug 2010 17:12:18 +0530 Subject: [PATCH] [FIX]: crm: Added checking for section_id in send mail wizard because some objects which don't have section_id uses this wizard bzr revid: rpa@tinyerp.com-20100810114218-afd2ov1x3f02q210 --- addons/crm/wizard/crm_send_email.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index aed957cb305..892b42ca460 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -177,7 +177,8 @@ class crm_send_new_email(osv.osv_memory): if 'email_from' in fields: res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or ''}) if 'reply_to' in fields: - res.update({'reply_to': case.section_id and case.section_id.reply_to or False}) + if hasattr(case, 'section_id'): + res.update({'reply_to': case.section_id and case.section_id.reply_to or False}) if 'subject' in fields: res.update({'subject': tools.ustr(context.get('subject', case.name) or '')}) if 'email_cc' in fields: @@ -236,7 +237,8 @@ class crm_send_new_email(osv.osv_memory): email_cc = (case.email_cc and tools.ustr(case.email_cc) + ', ' or '') + (hist.email_cc or '') res.update({'email_cc': email_cc}) if 'reply_to' in fields: - res.update({'reply_to': case.section_id.reply_to}) + if hasattr(case, 'section_id'): + res.update({'reply_to': case.section_id.reply_to}) if 'state' in fields: res['state'] = u'pending' return res