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

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-574487-msh/+merge/105309

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.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-574487-msh/+merge/105309
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-574487-msh.
=== modified file 'crm/crm_action_rule.py'
--- crm/crm_action_rule.py	2012-02-21 09:22:24 +0000
+++ crm/crm_action_rule.py	2012-05-10 10:29:17 +0000
@@ -117,8 +117,12 @@
         if hasattr(obj, 'email_cc') and action.act_email_cc:
             if '@' in (obj.email_cc or ''):
                 emails = obj.email_cc.split(",")
-                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
+                emails = [email.strip() for email in emails]
+                action_email_cc = [eval(email).strip() for email in action.act_email_cc.split(',')]
+                uniqueEmail = [email for index, email in enumerate(action_email_cc) if email not in emails]
+                uniqueEmail.extend(emails)
+                writeMail = ','.join(uniqueEmail)
+                write['email_cc'] = writeMail
             else:
                 write['email_cc'] = action.act_email_cc
 

=== modified file 'project_issue/project_issue_view.xml'
--- project_issue/project_issue_view.xml	2011-08-19 10:47:35 +0000
+++ project_issue/project_issue_view.xml	2012-05-10 10:29:17 +0000
@@ -95,7 +95,7 @@
                         </page>
                         <page string="Communication &amp; History" groups="base.group_extended">
                             <group colspan="4">
-                            <field colspan="4" name="email_cc" string="Global CC" widget="url"/>
+                            <field colspan="4" name="email_cc" string="Global CC" widget="email"/>
                             </group>
                             <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
                                 <tree string="History">

_______________________________________________
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