diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 4ebb0b4796d..85aa78b0ef6 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -488,8 +488,8 @@ class crm_case(crm_base): dest = case.user_id.user_email or "" body = case.description or "" for message in case.message_ids: - if message.email_from: - body = message.description + if message.email_from and message.body_text: + body = message.body_text break if not destination: @@ -516,7 +516,7 @@ class crm_case(crm_base): [dest], subject, body, - model='crm.case', + model=self._name, reply_to=case.section_id.reply_to, res_id=case.id, attachments=attach_to_send, diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 3947eb58156..76876df81e7 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -59,7 +59,7 @@ class base_action_rule(osv.osv): reply_to = emailfrom if not emailfrom: raise osv.except_osv(_('Error!'), _("No E-Mail Found for your Company address!")) - return mail_message.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, res_id=obj.id) + return mail_message.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model=obj._name, reply_to=reply_to, res_id=obj.id) def do_check(self, cr, uid, action, obj, context=None): ok = super(base_action_rule, self).do_check(cr, uid, action, obj, context=context) @@ -90,7 +90,6 @@ class base_action_rule(osv.osv): return ok def do_action(self, cr, uid, action, model_obj, obj, context=None): - res = super(base_action_rule, self).do_action(cr, uid, action, model_obj, obj, context=context) write = {} if hasattr(action, 'act_section_id') and action.act_section_id: obj.section_id = action.act_section_id