From ae92bbf2e24736b03c172257f35ebb0731aed98c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 20 Mar 2014 18:04:55 +0100 Subject: [PATCH] [IMP] mass_mailing: various usability improvements - See recipients on mailing form view: now opens the recipients in a popup, - Added a minimal form view for the contact list, used in the actions to create after choosing filter / domain / recipients, to avoid confusing the user, - Various small fixes in kanban view of campaign, - contact_list_ids m2m is now no_create, because there is a button to do it properly - changing model now reset the template bzr revid: tde@openerp.com-20140320170455-6vvudpin2bsp8ida --- addons/mass_mailing/models/mass_mailing.py | 14 +++++-- addons/mass_mailing/views/mass_mailing.xml | 46 ++++++++++++++++++---- addons/mass_mailing/views/res_partner.xml | 5 ++- 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index dfaad617082..a713d1430bc 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -127,9 +127,9 @@ class MassMailingList(osv.Model): def on_change_model(self, cr, uid, ids, model, context=None): values = {} if model == 'mail.mass_mailing.contact': - values.update(domain=False, filter_id=False) + values.update(domain=False, filter_id=False, template_id=False) else: - values.update(filter_id=False) + values.update(filter_id=False, template_id=False) return {'value': values} def on_change_filter_id(self, cr, uid, ids, filter_id, context=None): @@ -141,6 +141,13 @@ class MassMailingList(osv.Model): values['domain'] = False return {'value': values} + def on_change_domain(self, cr, uid, ids, domain, model, context=None): + if domain is False: + return {'value': {'contact_nbr': 0}} + else: + domain = eval(domain) + return {'value': {'contact_nbr': self.pool[model].search(cr, uid, domain, context=context, count=True)}} + def action_see_records(self, cr, uid, ids, context=None): contact_list = self.browse(cr, uid, ids[0], context=context) ctx = dict(context) @@ -546,7 +553,7 @@ class MassMailing(osv.Model): #------------------------------------------------------ def on_change_mailing_model(self, cr, uid, ids, mailing_model, context=None): - return {'value': {'contact_list_ids': []}} + return {'value': {'contact_list_ids': [], 'template_id': False, 'contact_nbr': 0}} def on_change_template_id(self, cr, uid, ids, template_id, context=None): values = {} @@ -591,6 +598,7 @@ class MassMailing(osv.Model): 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': mailing.mailing_model, + 'target': 'new', 'domain': domain, 'context': context, } diff --git a/addons/mass_mailing/views/mass_mailing.xml b/addons/mass_mailing/views/mass_mailing.xml index dc86fb6c947..8ce75aead5d 100644 --- a/addons/mass_mailing/views/mass_mailing.xml +++ b/addons/mass_mailing/views/mass_mailing.xml @@ -108,6 +108,35 @@ + + mail.mass_mailing.list.form.minimal + mail.mass_mailing.list + 20 + +
+
+
+ + + + + +
+
+
+ mail.mass_mailing.list.form mail.mass_mailing.list @@ -137,8 +166,7 @@ - - + @@ -221,7 +249,11 @@ - +