[FIX]crm: set salesteam responsible user as remind user for send remind user action.

bzr revid: atp@tinyerp.com-20110302102838-hwg2fqahjpxkoxnz
This commit is contained in:
Atul Patel (OpenERP) 2011-03-02 15:58:38 +05:30
parent 13b59bec4c
commit f6306b53ea
2 changed files with 9 additions and 7 deletions

View File

@ -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)

View File

@ -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: