From f6306b53ea3ccb4ed5a37cf5c15389604a76b97a Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Wed, 2 Mar 2011 15:58:38 +0530 Subject: [PATCH] [FIX]crm: set salesteam responsible user as remind user for send remind user action. bzr revid: atp@tinyerp.com-20110302102838-hwg2fqahjpxkoxnz --- addons/base_action_rule/base_action_rule.py | 1 - addons/crm/crm.py | 15 +++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index e22b6869c91..2a4e2c0e4e1 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -398,7 +398,6 @@ the rule to mark CC(mail to any other person defined in actions)."), if hasattr(model_obj, 'remind_user') and action.act_remind_user: model_obj.remind_user(cr, uid, [obj.id], context, attach=action.act_remind_attach) if hasattr(model_obj, 'remind_partner') and action.act_remind_partner: - context.update({'remind_partner': True}) model_obj.remind_partner(cr, uid, [obj.id], context, attach=action.act_remind_attach) if action.act_method: getattr(model_obj, 'act_method')(cr, uid, [obj.id], action, context) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index da216b31274..e566d119bf6 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -456,13 +456,15 @@ class crm_case(object): for case in self.browse(cr, uid, ids, context=context): if not case.section_id.reply_to: raise osv.except_osv(_('Error!'), ("Reply To is not specified in the sales team")) - - if context.get('remind_partner') and not case.email_from: + if not case.email_from: raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case")) - elif not context.get('remind_partner') and not case.user_id.user_email: - raise osv.except_osv(_('Error!'), ("User Email is not specified in Case")) - - case_email = context.get('remind_partner') and case.email_from or case.user_id.user_email + if not case.user_id.user_email: + raise osv.except_osv(_('Error!'), ("User Email is not specified in Case")) + if case.section_id.user_id: + case_email = case.section_id.user_id.user_email + else: + case_email = case.user_id.user_email + if case.section_id.reply_to and case_email: src = case_email dest = case.section_id.reply_to @@ -470,6 +472,7 @@ class crm_case(object): if case.message_ids: body = case.message_ids[0].description or "" if not destination: + src = case.email_from src, dest = dest, src if body and case.user_id.signature: if body: