From 71c73945facd6aed08cc1d355bb6e3bb94ec07bb Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 6 Nov 2012 20:12:55 +0100 Subject: [PATCH 01/10] [IMP] email template: add a email_to_partner field for send a email to a partner with the id bzr revid: chm@openerp.com-20121106191255-dd1xv90ebsejqunf --- addons/account/edi/invoice_action_data.xml | 1 + addons/email_template/email_template.py | 3 ++- addons/email_template/email_template_view.xml | 3 ++- .../wizard/email_template_preview_view.xml | 1 + .../email_template/wizard/mail_compose_message.py | 13 +++++++++++-- addons/mail/wizard/mail_compose_message_view.xml | 1 - addons/purchase/edi/purchase_order_action_data.xml | 3 ++- 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/addons/account/edi/invoice_action_data.xml b/addons/account/edi/invoice_action_data.xml index 53fa03a6902..e19b4df5c27 100644 --- a/addons/account/edi/invoice_action_data.xml +++ b/addons/account/edi/invoice_action_data.xml @@ -41,6 +41,7 @@ ${object.user_id.email or object.company_id.email or 'noreply@localhost'} ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' }) ${object.partner_id.email or ''} + ${object.partner_id.id} - + + diff --git a/addons/email_template/wizard/email_template_preview_view.xml b/addons/email_template/wizard/email_template_preview_view.xml index f91535a17a5..a3dbf40ad70 100644 --- a/addons/email_template/wizard/email_template_preview_view.xml +++ b/addons/email_template/wizard/email_template_preview_view.xml @@ -17,6 +17,7 @@ + diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index fe6f85da544..49f66734ae6 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -148,15 +148,24 @@ class mail_compose_message(osv.TransientModel): mail.compose.message, transform email_cc and email_to into partner_ids """ template_values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context) # filter template values - fields = ['body', 'body_html', 'subject', 'email_to', 'email_cc', 'attachments'] + fields = ['body', 'body_html', 'subject', 'email_to', 'email_to_partner', 'email_cc', 'attachments'] values = dict((field, template_values[field]) for field in fields if template_values.get(field)) values['body'] = values.pop('body_html', '') # transform email_to, email_cc into partner_ids values['partner_ids'] = [] - mails = tools.email_split(values.pop('email_to', '') + ' ' + values.pop('email_cc', '')) + + mails = tools.email_split( values.pop('email_to', '') + ' ' + values.pop('email_cc', '') ) for mail in mails: partner_id = self.pool.get('res.partner').find_or_create(cr, uid, mail, context=context) values['partner_ids'].append(partner_id) + + partner_ids = values.pop('email_to_partner', '').split(',') + for partner_id in partner_ids: + if partner_id: + values['partner_ids'].append(int(partner_id)) + + values['partner_ids'] = list(set(values['partner_ids'])) + return values def render_message(self, cr, uid, wizard, res_id, context=None): diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index 5e571eb4338..7b2f5632cbd 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -15,7 +15,6 @@ diff --git a/addons/purchase/edi/purchase_order_action_data.xml b/addons/purchase/edi/purchase_order_action_data.xml index daad4467929..8464c533696 100644 --- a/addons/purchase/edi/purchase_order_action_data.xml +++ b/addons/purchase/edi/purchase_order_action_data.xml @@ -40,7 +40,8 @@ Automated Purchase Order Notification Mail ${object.validator.email or ''} ${object.company_id.name} Order (Ref ${object.name or 'n/a' }) - ${object.partner_id.email} + ${object.partner_id.email or ''} + ${object.partner_id.id} Date: Wed, 7 Nov 2012 11:27:45 +0100 Subject: [PATCH 02/10] [IMP] email_template: add test: The fields email_to, email_to_partner and email_cc return the good list of partner_id bzr revid: chm@openerp.com-20121107102745-9d0dt1fkzauvfyjs --- addons/email_template/tests/test_mail.py | 82 +++++++++++++++++------- 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/addons/email_template/tests/test_mail.py b/addons/email_template/tests/test_mail.py index 7af05f38b0e..5db90504db3 100644 --- a/addons/email_template/tests/test_mail.py +++ b/addons/email_template/tests/test_mail.py @@ -32,6 +32,8 @@ class test_message_compose(test_mail.TestMailMockups): self.mail_message = self.registry('mail.message') self.res_users = self.registry('res.users') self.res_partner = self.registry('res.partner') + self.mail_compose = self.registry('mail.compose.message') + self.email_template = self.registry('email.template') # create a 'pigs' and 'bird' groups that will be used through the various tests self.group_pigs_id = self.mail_group.create(self.cr, self.uid, @@ -40,9 +42,8 @@ class test_message_compose(test_mail.TestMailMockups): {'name': 'Bird', 'description': 'I am angry !'}) def test_00_message_compose_wizard(self): - """ Tests designed for the mail.compose.message wizard updated by email_template. """ + """ Tests designed for the mail.compose.message wizard updated by self.email_template. """ cr, uid = self.cr, self.uid - mail_compose = self.registry('mail.compose.message') self.res_users.write(cr, uid, [uid], {'signature': 'Admin', 'email': 'a@a.a'}) user_admin = self.res_users.browse(cr, uid, uid) p_a_id = user_admin.partner_id.id @@ -62,8 +63,7 @@ class test_message_compose(test_mail.TestMailMockups): # Create template on mail.group, with attachments group_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'mail.group')])[0] - email_template = self.registry('email.template') - email_template_id = email_template.create(cr, uid, {'model_id': group_model_id, + self.email_template_id = self.email_template.create(cr, uid, {'model_id': group_model_id, 'name': 'Pigs Template', 'subject': '${object.name}', 'body_html': '${object.description}', 'user_signature': True, 'attachment_ids': [(0, 0, _attachments[0]), (0, 0, _attachments[1])], @@ -74,37 +74,37 @@ class test_message_compose(test_mail.TestMailMockups): # ---------------------------------------- # 1. Comment on pigs - compose_id = mail_compose.create(cr, uid, + compose_id = self.mail_compose.create(cr, uid, {'subject': 'Forget me subject', 'body': '

Dummy body

'}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_pigs_id, - 'default_template_id': email_template_id, + 'default_template_id': self.email_template_id, 'active_ids': [self.group_pigs_id, self.group_bird_id]}) - compose = mail_compose.browse(cr, uid, compose_id) + compose = self.mail_compose.browse(cr, uid, compose_id) # 2. Save current composition form as a template - mail_compose.save_as_template(cr, uid, [compose_id], context={'default_model': 'mail.group'}) - # Test: email_template subject, body_html, model - last_template_id = email_template.search(cr, uid, [('model', '=', 'mail.group'), ('subject', '=', 'Forget me subject')], limit=1)[0] - self.assertTrue(last_template_id, 'email_template not found for model mail.group, subject Forget me subject') - last_template = email_template.browse(cr, uid, last_template_id) - self.assertEqual(last_template.body_html, '

Dummy body

', 'email_template incorrect body_html') + self.mail_compose.save_as_template(cr, uid, [compose_id], context={'default_model': 'mail.group'}) + # Test: self.email_template subject, body_html, model + last_template_id = self.email_template.search(cr, uid, [('model', '=', 'mail.group'), ('subject', '=', 'Forget me subject')], limit=1)[0] + self.assertTrue(last_template_id, 'self.email_template not found for model mail.group, subject Forget me subject') + last_template = self.email_template.browse(cr, uid, last_template_id) + self.assertEqual(last_template.body_html, '

Dummy body

', 'self.email_template incorrect body_html') # ---------------------------------------- # CASE2: comment with template, save as template # ---------------------------------------- # 1. Comment on pigs - compose_id = mail_compose.create(cr, uid, + compose_id = self.mail_compose.create(cr, uid, {'subject': 'Forget me subject', 'body': 'Dummy body'}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_pigs_id, - 'default_template_id': email_template_id, + 'default_template_id': self.email_template_id, 'active_ids': [self.group_pigs_id, self.group_bird_id]}) - compose = mail_compose.browse(cr, uid, compose_id) + compose = self.mail_compose.browse(cr, uid, compose_id) # 2. Perform 'toggle_template', to set use_template and use template_id - mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) + self.mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) compose.refresh() message_pids = [partner.id for partner in compose.partner_ids] partner_ids = self.res_partner.search(cr, uid, [('email', 'in', ['b@b.b', 'c@c.c', 'd@d.d'])]) @@ -122,7 +122,7 @@ class test_message_compose(test_mail.TestMailMockups): 'mail.message attachment name / data incorrect') # 3. Perform 'toggle_template': template is not set anymore - mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) + self.mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) compose.refresh() # Test: subject, body, partner_ids self.assertEqual(compose.subject, False, 'mail.compose.message subject incorrect') @@ -133,17 +133,17 @@ class test_message_compose(test_mail.TestMailMockups): # ---------------------------------------- # 1. Mass_mail on pigs and bird, with a default_partner_ids set to check he is correctly added - compose_id = mail_compose.create(cr, uid, + compose_id = self.mail_compose.create(cr, uid, {'subject': 'Forget me subject', 'body': 'Dummy body'}, {'default_composition_mode': 'mass_mail', 'default_model': 'mail.group', 'default_res_id': self.group_pigs_id, - 'default_template_id': email_template_id, + 'default_template_id': self.email_template_id, 'default_partner_ids': [p_a_id], 'active_ids': [self.group_pigs_id, self.group_bird_id]}) - compose = mail_compose.browse(cr, uid, compose_id) + compose = self.mail_compose.browse(cr, uid, compose_id) # 2. Perform 'toggle_template', to set use_template and use template_id - mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) + self.mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) compose.refresh() message_pids = [partner.id for partner in compose.partner_ids] partner_ids = [p_a_id] @@ -154,7 +154,7 @@ class test_message_compose(test_mail.TestMailMockups): self.assertEqual(set(message_pids), set(partner_ids), 'mail.compose.message partner_ids incorrect') # 3. Post the comment, get created message - mail_compose.send_mail(cr, uid, [compose_id], {'default_res_id': -1, 'active_ids': [self.group_pigs_id, self.group_bird_id]}) + self.mail_compose.send_mail(cr, uid, [compose_id], {'default_res_id': -1, 'active_ids': [self.group_pigs_id, self.group_bird_id]}) group_pigs.refresh() group_bird.refresh() message_pigs = group_pigs.message_ids[0] @@ -170,3 +170,39 @@ class test_message_compose(test_mail.TestMailMockups): partner_ids = self.res_partner.search(cr, uid, [('email', 'in', ['b@b.b', 'c@c.c', 'd@d.d'])]) self.assertEqual(set(message_pigs_pids), set(partner_ids), 'mail.message on pigs incorrect number of notified_partner_ids') self.assertEqual(set(message_bird_pids), set(partner_ids), 'mail.message on bird notified_partner_ids incorrect') + + + def test_10_template_email_for_composer(self): + """ Tests designed for message_post. """ + cr, uid = self.cr, self.uid + + # 1 - Bert Tartopoils, with email, object to send message, add his partner_id from email_to + u_a_id = self.res_users.create(cr, uid, {'name': 'Bert Tartopoils', 'email': 'raoul@raoul.fr', 'login': 'raoul'}) + p_a_id = self.res_users.browse(cr, uid, u_a_id).partner_id.id + # 2 - Carine Poilvache, with email, add his partner_id from email_to and email_to_partner + p_b_id = self.res_partner.create(cr, uid, {'name': 'Carine Poilvache', 'email': 'c@c'}) + # 3 - Dédé Grosbedon, without email, add his partner_id from email_to_partner + p_c_id = self.res_partner.create(cr, uid, {'name': 'Dédé Grosbedon'}) + # 4 - Truc Much, without email, add his partner_id from email_cc + p_d_id = self.res_partner.create(cr, uid, {'name': 'Truc Much', 'email': 'd@d'}) + + # Create template on res.users + user_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'res.users')])[0] + self.email_template_id = self.email_template.create(cr, uid, { + 'model_id': user_model_id, + 'name': 'Pigs Template', + 'subject': '${object.name}', + 'body_html': '${object.login}', + 'email_to': '${object.email} c@c', + 'email_to_partner': '%i,%i' % (p_b_id, p_c_id), + 'email_cc': 'd@d' + }) + + # patner by email + partner by id (no double) + send_to = [p_a_id, p_b_id, p_c_id, p_d_id]; + + # Generate messsage with default email and partner on template + mail_value = self.mail_compose.generate_email_for_composer(cr, uid, self.email_template_id, u_a_id) + mail_value['partner_ids'].sort() + + self.assertEqual(mail_value['partner_ids'], send_to, 'mail.message the partner_ids list create by template is incorrect') From 42dd7711b59d5c4774ac921123d64fdbbe1181ce Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 7 Nov 2012 12:39:25 +0100 Subject: [PATCH 03/10] [FIX] email_template: change name value and concat test bzr revid: chm@openerp.com-20121107113925-1nmjicj444nez25c --- addons/account/edi/invoice_action_data.xml | 3 +-- addons/email_template/email_template.py | 6 ++--- addons/email_template/email_template_view.xml | 2 +- addons/email_template/tests/test_mail.py | 23 ++++++++----------- .../wizard/email_template_preview_view.xml | 2 +- .../wizard/mail_compose_message.py | 4 ++-- .../edi/purchase_order_action_data.xml | 3 +-- 7 files changed, 18 insertions(+), 25 deletions(-) diff --git a/addons/account/edi/invoice_action_data.xml b/addons/account/edi/invoice_action_data.xml index e19b4df5c27..d86ebca3537 100644 --- a/addons/account/edi/invoice_action_data.xml +++ b/addons/account/edi/invoice_action_data.xml @@ -40,8 +40,7 @@ Automated Invoice Notification Mail ${object.user_id.email or object.company_id.email or 'noreply@localhost'} ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' }) - ${object.partner_id.email or ''} - ${object.partner_id.id} + ${object.partner_id.id} - + diff --git a/addons/email_template/tests/test_mail.py b/addons/email_template/tests/test_mail.py index 5db90504db3..769a1c2f9f7 100644 --- a/addons/email_template/tests/test_mail.py +++ b/addons/email_template/tests/test_mail.py @@ -172,20 +172,18 @@ class test_message_compose(test_mail.TestMailMockups): self.assertEqual(set(message_bird_pids), set(partner_ids), 'mail.message on bird notified_partner_ids incorrect') - def test_10_template_email_for_composer(self): - """ Tests designed for message_post. """ - cr, uid = self.cr, self.uid + # ---------------------------------------- + # CASE4: Created message with template, test recipients + # ---------------------------------------- - # 1 - Bert Tartopoils, with email, object to send message, add his partner_id from email_to - u_a_id = self.res_users.create(cr, uid, {'name': 'Bert Tartopoils', 'email': 'raoul@raoul.fr', 'login': 'raoul'}) - p_a_id = self.res_users.browse(cr, uid, u_a_id).partner_id.id - # 2 - Carine Poilvache, with email, add his partner_id from email_to and email_to_partner + # 1 - Admin, with email, object to send message, add his partner_id from email_to + # p_a_id + # 2 - Carine Poilvache, with email, add his partner_id from email_to and email_recipients p_b_id = self.res_partner.create(cr, uid, {'name': 'Carine Poilvache', 'email': 'c@c'}) - # 3 - Dédé Grosbedon, without email, add his partner_id from email_to_partner + # 3 - Dédé Grosbedon, without email, add his partner_id from email_recipients p_c_id = self.res_partner.create(cr, uid, {'name': 'Dédé Grosbedon'}) # 4 - Truc Much, without email, add his partner_id from email_cc p_d_id = self.res_partner.create(cr, uid, {'name': 'Truc Much', 'email': 'd@d'}) - # Create template on res.users user_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'res.users')])[0] self.email_template_id = self.email_template.create(cr, uid, { @@ -194,15 +192,12 @@ class test_message_compose(test_mail.TestMailMockups): 'subject': '${object.name}', 'body_html': '${object.login}', 'email_to': '${object.email} c@c', - 'email_to_partner': '%i,%i' % (p_b_id, p_c_id), + 'email_recipients': '%i,%i' % (p_b_id, p_c_id), 'email_cc': 'd@d' }) # patner by email + partner by id (no double) send_to = [p_a_id, p_b_id, p_c_id, p_d_id]; - # Generate messsage with default email and partner on template mail_value = self.mail_compose.generate_email_for_composer(cr, uid, self.email_template_id, u_a_id) - mail_value['partner_ids'].sort() - - self.assertEqual(mail_value['partner_ids'], send_to, 'mail.message the partner_ids list create by template is incorrect') + self.assertEqual(set(mail_value['partner_ids']), set(send_to), 'mail.message the partner_ids list create by template is incorrect') diff --git a/addons/email_template/wizard/email_template_preview_view.xml b/addons/email_template/wizard/email_template_preview_view.xml index a3dbf40ad70..8dd4bc92ba7 100644 --- a/addons/email_template/wizard/email_template_preview_view.xml +++ b/addons/email_template/wizard/email_template_preview_view.xml @@ -17,7 +17,7 @@ - + diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 49f66734ae6..1f69377cf53 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -148,7 +148,7 @@ class mail_compose_message(osv.TransientModel): mail.compose.message, transform email_cc and email_to into partner_ids """ template_values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context) # filter template values - fields = ['body', 'body_html', 'subject', 'email_to', 'email_to_partner', 'email_cc', 'attachments'] + fields = ['body', 'body_html', 'subject', 'email_to', 'email_recipients', 'email_cc', 'attachments'] values = dict((field, template_values[field]) for field in fields if template_values.get(field)) values['body'] = values.pop('body_html', '') # transform email_to, email_cc into partner_ids @@ -159,7 +159,7 @@ class mail_compose_message(osv.TransientModel): partner_id = self.pool.get('res.partner').find_or_create(cr, uid, mail, context=context) values['partner_ids'].append(partner_id) - partner_ids = values.pop('email_to_partner', '').split(',') + partner_ids = values.pop('email_recipients', '').split(',') for partner_id in partner_ids: if partner_id: values['partner_ids'].append(int(partner_id)) diff --git a/addons/purchase/edi/purchase_order_action_data.xml b/addons/purchase/edi/purchase_order_action_data.xml index 8464c533696..fab7eeacf6c 100644 --- a/addons/purchase/edi/purchase_order_action_data.xml +++ b/addons/purchase/edi/purchase_order_action_data.xml @@ -40,8 +40,7 @@ Automated Purchase Order Notification Mail ${object.validator.email or ''} ${object.company_id.name} Order (Ref ${object.name or 'n/a' }) - ${object.partner_id.email or ''} - ${object.partner_id.id} + ${object.partner_id.id} Date: Tue, 13 Nov 2012 12:20:38 +0100 Subject: [PATCH 04/10] [FIX] sale, purchase, account: send by email button calls the mail.compose.message in comment mode. bzr revid: tde@openerp.com-20121113112038-hwp41jldofq1al6k --- addons/account/account_invoice.py | 1 + addons/purchase/purchase.py | 1 + addons/sale/sale.py | 1 + 3 files changed, 3 insertions(+) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index b37118c3baa..409551585fa 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -402,6 +402,7 @@ class account_invoice(osv.osv): 'default_res_id': ids[0], 'default_use_template': True, 'default_template_id': template_id, + 'default_composition_mode': 'comment', }) return { 'view_type': 'form', diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 0227e74905f..5bb38316604 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -395,6 +395,7 @@ class purchase_order(osv.osv): 'default_res_id': ids[0], 'default_use_template': True, 'default_template_id': template_id, + 'default_composition_mode': 'comment', }) return { 'view_type': 'form', diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 3c21492827f..5fe84c34bc3 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -645,6 +645,7 @@ class sale_order(osv.osv): 'default_res_id': ids[0], 'default_use_template': True, 'default_template_id': template_id, + 'default_composition_mode': 'comment', 'mark_so_as_sent': True }) return { From a370d1c0598a52b4a2020289620d45a27e65a36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 13 Nov 2012 12:36:25 +0100 Subject: [PATCH 05/10] [IMP] email_template: relooked a bit the mail.compose.message wizard, use_template by default, on bottom-right choose the template; rendre only when use_template and template_id set. bzr revid: tde@openerp.com-20121113113625-fg3jp3047gnrx2wr --- .../wizard/mail_compose_message.py | 9 ++++-- .../wizard/mail_compose_message_view.xml | 32 +++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 1f69377cf53..742f9646406 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -52,8 +52,9 @@ class mail_compose_message(osv.TransientModel): context = {} result = super(mail_compose_message, self).default_get(cr, uid, fields, context=context) result['template_id'] = context.get('default_template_id', context.get('mail.compose.template_id', False)) + # pre-render the template if any - if result.get('use_template'): + if result.get('use_template') and result.get('template_id'): onchange_res = self.onchange_use_template(cr, uid, [], result.get('use_template'), result.get('template_id'), result.get('composition_mode'), result.get('model'), result.get('res_id'), context=context) result.update(onchange_res['value']) @@ -65,6 +66,10 @@ class mail_compose_message(osv.TransientModel): 'template_id': fields.selection(_get_templates, 'Template', size=-1), } + _defaults = { + 'use_template': True, + } + def onchange_template_id(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None): """ - use_template not set: return default_get - use_template set in mass_mailing: we cannot render, so return the template values @@ -154,7 +159,7 @@ class mail_compose_message(osv.TransientModel): # transform email_to, email_cc into partner_ids values['partner_ids'] = [] - mails = tools.email_split( values.pop('email_to', '') + ' ' + values.pop('email_cc', '') ) + mails = tools.email_split(values.pop('email_to', '') + ' ' + values.pop('email_cc', '')) for mail in mails: partner_id = self.pool.get('res.partner').find_or_create(cr, uid, mail, context=context) values['partner_ids'].append(partner_id) diff --git a/addons/email_template/wizard/mail_compose_message_view.xml b/addons/email_template/wizard/mail_compose_message_view.xml index 05d0e8dffa1..0a530299d4a 100644 --- a/addons/email_template/wizard/mail_compose_message_view.xml +++ b/addons/email_template/wizard/mail_compose_message_view.xml @@ -8,23 +8,23 @@ - - - - - + + - -