Merge lp:~openerp-dev/openobject-addons/6.1-opw-578178-msh into lp:openobject-addons/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-578178-msh
Merge into: lp:openobject-addons/6.1
Diff against target: 20 lines (+4/-4)
1 file modified
crm/crm_action_rule.py (+4/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-578178-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+120531@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6957. By Mohammed Shekha(Open ERP)

[FIX]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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm/crm_action_rule.py'
2--- crm/crm_action_rule.py 2012-03-16 14:42:51 +0000
3+++ crm/crm_action_rule.py 2012-08-21 10:20:40 +0000
4@@ -97,12 +97,12 @@
5 write['section_id'] = action.act_section_id.id
6
7 if hasattr(obj, 'email_cc') and action.act_email_cc:
8- if '@' in (obj.email_cc or ''):
9+ if '@' in (obj.email_cc or '') and action.act_mail_to_watchers:
10 emails = obj.email_cc.split(",")
11- if obj.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
12- write['email_cc'] = obj.email_cc + ',' + obj.act_email_cc
13+ if action.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
14+ write['email_cc'] = obj.email_cc + ',' + action.act_email_cc
15 else:
16- write['email_cc'] = obj.act_email_cc
17+ write['email_cc'] = obj.email_cc
18
19 # Put state change by rule in communication history
20 if hasattr(obj, 'state') and hasattr(obj, 'message_append') and action.act_state: