diff options
| author | Harry (Open ERP) <hmo@tinyerp.com> | 2009-11-10 11:21:33 +0530 |
|---|---|---|
| committer | Harry (Open ERP) <hmo@tinyerp.com> | 2009-11-10 11:21:33 +0530 |
| commit | 261f317cedbc703ec4e9e803720f74bb428bb0ba (patch) | |
| tree | c46cbeb6aec07984428193d3c9a1b73ec734bd94 /addons | |
| parent | b1a88d6ecf3dc31e4c6bb61033238d11030466e5 (diff) | |
[IMP]crm : in add CC wizard, raise exception if mail is not sent
bzr revid: hmo@tinyerp.com-20091110055133-fg9z5pwdr99r61io
Diffstat (limited to 'addons')
| -rwxr-xr-x | addons/crm/crm.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 8b3f1caa4c7..603b17a1aa6 100755 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -1076,8 +1076,7 @@ class crm_email_add_cc_wizard(osv.osv_memory): history_line = self.pool.get('crm.case.history').browse(cr, uid, context['active_id']) crm_case = self.pool.get('crm.case') case = history_line.log_id.case_id - body = history_line.description.replace('\n','\n> ') - crm_case.write(cr, uid, case.id, {'email_cc' : email}) + body = history_line.description.replace('\n','\n> ') flag = tools.email_send( case.user_id.address_id.email, [case.email_from], @@ -1087,7 +1086,9 @@ class crm_email_add_cc_wizard(osv.osv_memory): tinycrm=str(case.id) ) if flag: - cr.commit() + crm_case.write(cr, uid, case.id, {'email_cc' : case.email_cc and case.email_cc +','+ email or email}) + else: + raise osv.except_osv(_('Email Fail!'),("Lastest Email is not sent successfully")) return {} crm_email_add_cc_wizard() |
