Merge lp:~openerp-dev/openobject-addons/6.0-opw-574487-msh into lp:openobject-addons/6.0

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-574487-msh
Merge into: lp:openobject-addons/6.0
Diff against target: 37 lines (+9/-5)
2 files modified
crm/crm_action_rule.py (+8/-4)
project_issue/project_issue_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-574487-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+105309@code.launchpad.net

Description of the change

Hello,

Fixed the issue of duplicated emails in object from email action, as well as changed the widget from url to email in Global CC of project.issue.

Demo :- Create an automated action say for example on project.issue which triggered when case is in progress state, now set email action and set Add Watcher(CC) field with some emails, now go to project.issue and create an issue with emails in Global CC, here if there is an email which is already in automated action then it will be duplcated in Global CC field when action is triggered.

Also In project Issue we have given a widget=url in Global CC, so changed it widget="email", widget=url will not work with web as web will validate the data as a url widget which is actually email.

Thanks.

To post a comment you must log in.
5224. By Mohammed Shekha(Open ERP)

[FIX]Refixed the iissue as obj.email_cc will not work, it will duplicate the emails, so changed the code, to remove duplication when user have used obj.email_cc in automated action.

Unmerged revisions

5224. By Mohammed Shekha(Open ERP)

[FIX]Refixed the iissue as obj.email_cc will not work, it will duplicate the emails, so changed the code, to remove duplication when user have used obj.email_cc in automated 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-02-21 09:22:24 +0000
3+++ crm/crm_action_rule.py 2012-05-11 05:33:19 +0000
4@@ -115,12 +115,16 @@
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 (action.act_email_cc or '') and action.act_mail_to_watchers:
10 emails = obj.email_cc.split(",")
11- if action.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
12- write['email_cc'] = obj.email_cc+','+action.act_email_cc
13+ emails = [email.strip() for email in emails]
14+ action_email_cc = [eval(email).strip() for email in action.act_email_cc.split(',')]
15+ uniqueEmail = [email for index, email in enumerate(action_email_cc) if email not in emails]
16+ uniqueEmail.extend(emails)
17+ writeMail = ','.join(uniqueEmail)
18+ write['email_cc'] = writeMail
19 else:
20- write['email_cc'] = action.act_email_cc
21+ write['email_cc'] = obj.email_cc
22
23 # Put state change by rule in communication history
24 if hasattr(obj, 'state') and action.act_state:
25
26=== modified file 'project_issue/project_issue_view.xml'
27--- project_issue/project_issue_view.xml 2011-08-19 10:47:35 +0000
28+++ project_issue/project_issue_view.xml 2012-05-11 05:33:19 +0000
29@@ -95,7 +95,7 @@
30 </page>
31 <page string="Communication &amp; History" groups="base.group_extended">
32 <group colspan="4">
33- <field colspan="4" name="email_cc" string="Global CC" widget="url"/>
34+ <field colspan="4" name="email_cc" string="Global CC" widget="email"/>
35 </group>
36 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
37 <tree string="History">