From 7d3ffc294fc5fc8f2d051ddab19af3d676f3d8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 12 Apr 2017 10:25:28 +0200 Subject: [PATCH] [ADD] mass_mailing_event: add mass mailing UX on event for attendees If the event has some attendees a button is displayed to launch a mass mailing on those attendees. This button requires a new bridge module between mass mailing and event. --- addons/mass_mailing_event/__init__.py | 4 ++++ addons/mass_mailing_event/__manifest__.py | 20 ++++++++++++++++ addons/mass_mailing_event/models/__init__.py | 4 ++++ addons/mass_mailing_event/models/event.py | 23 +++++++++++++++++++ .../mass_mailing_event/views/event_views.xml | 18 +++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 addons/mass_mailing_event/__init__.py create mode 100644 addons/mass_mailing_event/__manifest__.py create mode 100644 addons/mass_mailing_event/models/__init__.py create mode 100644 addons/mass_mailing_event/models/event.py create mode 100644 addons/mass_mailing_event/views/event_views.xml diff --git a/addons/mass_mailing_event/__init__.py b/addons/mass_mailing_event/__init__.py new file mode 100644 index 00000000000..81fc81d29c9 --- /dev/null +++ b/addons/mass_mailing_event/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +import models diff --git a/addons/mass_mailing_event/__manifest__.py b/addons/mass_mailing_event/__manifest__.py new file mode 100644 index 00000000000..5c838febe2a --- /dev/null +++ b/addons/mass_mailing_event/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +{ + 'name': 'Mass mailing on attendees', + 'category': 'Hidden', + 'version': '1.0', + 'description': + """ +Mass mail event attendees +========================= + +Bridge module adding UX requirements to ease mass mailing of event attendees. + """, + 'depends': ['event', 'mass_mailing'], + 'data': [ + 'views/event_views.xml' + ], + 'auto_install': True, +} diff --git a/addons/mass_mailing_event/models/__init__.py b/addons/mass_mailing_event/models/__init__.py new file mode 100644 index 00000000000..770d2eb5797 --- /dev/null +++ b/addons/mass_mailing_event/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +import event diff --git a/addons/mass_mailing_event/models/event.py b/addons/mass_mailing_event/models/event.py new file mode 100644 index 00000000000..5cbe2b6bd8c --- /dev/null +++ b/addons/mass_mailing_event/models/event.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + + +class Event(models.Model): + _inherit = "event.event" + + def action_mass_mailing_attendees(self): + mass_mailing_action = dict( + name='Mass Mail Attendees', + type='ir.actions.act_window', + res_model='mail.mass_mailing', + view_type='form', + view_mode='form', + target='current', + context=dict( + default_mailing_model='event.registration', + default_mailing_domain="[('event_id', 'in', %s)]" % self.ids, # , ('state', 'in', ['draft', 'open', 'done']) + ), + ) + return mass_mailing_action \ No newline at end of file diff --git a/addons/mass_mailing_event/views/event_views.xml b/addons/mass_mailing_event/views/event_views.xml new file mode 100644 index 00000000000..e3105fad8eb --- /dev/null +++ b/addons/mass_mailing_event/views/event_views.xml @@ -0,0 +1,18 @@ + + + + event.event.view.form.inherit.mass.mailing + event.event + + + + + + +