Browse Source

upload mass_mailing_extra

pull/1/head
Ivan Yelizariev 10 years ago
commit
63ad78c0e8
  1. 1
      __init__.py
  2. 20
      __openerp__.py
  3. 16
      models.py
  4. 32
      views.xml

1
__init__.py

@ -0,0 +1 @@
import models

20
__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
}

16
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)

32
views.xml

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_mail_mail_statistics_form">
<field name="name">mail.mail.statistics.form</field>
<field name="model">mail.mail.statistics</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<notebook>
<page string="Partners">
<field name="partner_ids" readonly="1"/>
</page>
</notebook>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_mail_mail_statistics_tree">
<field name="name">mail.mail.statistics.tree</field>
<field name="model">mail.mail.statistics</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='mail_mail_id_int']" position="before">
<field name="partner_ids_text"/>
</xpath>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save