[FIX]: crm - send reminder uses wrong "from" email

bzr revid: atp@tinyerp.com-20110223060737-88tydzckko1b4j8m
This commit is contained in:
Atul Patel (OpenERP) 2011-02-23 11:37:37 +05:30
parent 91c1768528
commit 13b59bec4c
2 changed files with 10 additions and 4 deletions

View File

@ -398,6 +398,7 @@ 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

@ -441,6 +441,7 @@ class crm_case(object):
@param context: A standard dictionary for contextual values
"""
return self.remind_user(cr, uid, ids, context, attach,
destination=False)
@ -451,15 +452,19 @@ class crm_case(object):
@param uid: the current users ID for security checks,
@param ids: List of Remind user's IDs
@param context: A standard dictionary for contextual values
"""
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 not case.email_from:
if context.get('remind_partner') and not case.email_from:
raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case"))
if case.section_id.reply_to and case.email_from:
src = case.email_from
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 case.section_id.reply_to and case_email:
src = case_email
dest = case.section_id.reply_to
body = case.description or ""
if case.message_ids: