Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-578178-msh into 
lp:openobject-addons/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578178-msh/+merge/120531

Hello,

Fixed the issue of crm action, here act_email_cc is retrieved from obj on which 
the action is defined but act_email_cc is the field of base_action_rule so it 
should be retrieved from action, and also checked whether act_mail_to_watchers 
is checked or not, if checked then and then only truncate the email_cc of 
action.

Demo :- Create an automated action on crm.helpdesk when state is going to 
pending.
Now go to any new record of crm.helpdesk and put it in to pending you will get 
traceback that act_email_cc is not in browse_record.

Reason :- act_email_cc is the field of action(nase_action_rule, action is the 
browse object of base_action and obj is the object of object on which action is 
defined.), so if act_mail_to_watchers is checked then truncate email_cc + 
act_email_cc otherwise only email_cc.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578178-msh/+merge/120531
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-578178-msh.
=== modified file 'crm/crm_action_rule.py'
--- crm/crm_action_rule.py	2012-03-16 14:42:51 +0000
+++ crm/crm_action_rule.py	2012-08-21 10:20:40 +0000
@@ -97,12 +97,12 @@
             write['section_id'] = action.act_section_id.id
 
         if hasattr(obj, 'email_cc') and action.act_email_cc:
-            if '@' in (obj.email_cc or ''):
+            if '@' in (obj.email_cc or '') and action.act_mail_to_watchers:
                 emails = obj.email_cc.split(",")
-                if  obj.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
-                    write['email_cc'] = obj.email_cc + ',' + obj.act_email_cc
+                if  action.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
+                    write['email_cc'] = obj.email_cc + ',' + action.act_email_cc
             else:
-                write['email_cc'] = obj.act_email_cc
+                write['email_cc'] = obj.email_cc
 
         # Put state change by rule in communication history
         if hasattr(obj, 'state') and hasattr(obj, 'message_append') and action.act_state:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to