← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-722723-atp into lp:openobject-addons

 

Atul Patel(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-722723-atp into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  #722723 [6.0] crm - send reminder uses wrong "from" email
  https://bugs.launchpad.net/bugs/722723

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-722723-atp/+merge/50875

1) crm - send reminder uses wrong "from" email 
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-722723-atp/+merge/50875
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-722723-atp.
=== modified file 'base_action_rule/base_action_rule.py'
--- base_action_rule/base_action_rule.py	2011-02-01 06:42:45 +0000
+++ base_action_rule/base_action_rule.py	2011-02-23 06:11:20 +0000
@@ -398,6 +398,7 @@
         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)

=== modified file 'crm/crm.py'
--- crm/crm.py	2011-02-22 14:15:01 +0000
+++ crm/crm.py	2011-02-23 06:11:20 +0000
@@ -441,6 +441,7 @@
         @param context: A standard dictionary for contextual values
 
         """
+        
         return self.remind_user(cr, uid, ids, context, attach,
                 destination=False)
 
@@ -451,15 +452,19 @@
         @param uid: the current user’s 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:


Follow ups