From 63ad78c0e8da2349c4615f3d32600a9631fa424b Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 24 Nov 2014 15:53:26 +0200 Subject: [PATCH] upload mass_mailing_extra --- __init__.py | 1 + __openerp__.py | 20 ++++++++++++++++++++ models.py | 16 ++++++++++++++++ views.xml | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 __init__.py create mode 100644 __openerp__.py create mode 100644 models.py create mode 100644 views.xml diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..bff786c --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +import models diff --git a/__openerp__.py b/__openerp__.py new file mode 100644 index 0000000..a372310 --- /dev/null +++ b/__openerp__.py @@ -0,0 +1,20 @@ +{ + 'name' : 'Improvements for mass mailing', + 'version' : '1.0.0', + 'author' : 'Ivan Yelizariev', + 'category' : 'Mail', + 'website' : 'https://it-projects.info', + 'description': """ +Modules adds: + +* partners info in mail.mail.statistics tree +* partners info in mail.mail.statistics form + +Tested on 8.0 f8d5a6727d3e8d428d9bef93da7ba6b11f344284 + """, + 'depends' : ['mass_mailing'], + 'data':[ + 'views.xml', + ], + 'installable': True +} diff --git a/models.py b/models.py new file mode 100644 index 0000000..0d8c4d6 --- /dev/null +++ b/models.py @@ -0,0 +1,16 @@ +from openerp import api,models,fields + +class MailMailStats(models.Model): + + _inherit = 'mail.mail.statistics' + + partner_ids = fields.Many2many('res.partner', related='mail_mail_id.recipient_ids', string='Partners') + + @api.one + def _get_partner_ids_text(self): + res = [] + for p in self.partner_ids: + res.append('%s <%s>' % (p.name, p.email)) + self.partner_ids_text = ', '.join(res) + + partner_ids_text = fields.Char('Partners', compute=_get_partner_ids_text) diff --git a/views.xml b/views.xml new file mode 100644 index 0000000..34a67a8 --- /dev/null +++ b/views.xml @@ -0,0 +1,32 @@ + + + + + + mail.mail.statistics.form + mail.mail.statistics + + + + + + + + + + + + + + mail.mail.statistics.tree + mail.mail.statistics + + + + + + + + + +