[IMP] mass_mailing: campaign and mailing kanban view update
to match new specs, removed unnecessary CSS. Also added a sent field on mail mail statistics, to be able to count the number of really sent emails. bzr revid: tde@openerp.com-20140317160919-7sx7ja28zaxid67t
This commit is contained in:
parent
b778e5c7fa
commit
61f90f4581
|
@ -63,3 +63,8 @@ class MailMail(osv.Model):
|
||||||
if tracking_url:
|
if tracking_url:
|
||||||
body = tools.append_content_to_html(body, tracking_url, plaintext=False, container_tag='div')
|
body = tools.append_content_to_html(body, tracking_url, plaintext=False, container_tag='div')
|
||||||
return body
|
return body
|
||||||
|
|
||||||
|
def _postprocess_sent_message(self, cr, uid, mail, context=None):
|
||||||
|
if mail.state == 'sent' and mail.statistics_ids:
|
||||||
|
self.pool['mail.mail.statistics'].write(cr, uid, [s.id for s in mail.statistics_ids], {'sent': fields.datetime.now()}, context=context)
|
||||||
|
return super(MailMail, self)._postprocess_sent_message(cr, uid, mail, context=context)
|
||||||
|
|
|
@ -178,30 +178,17 @@ class MassMailingCampaign(osv.Model):
|
||||||
|
|
||||||
def _get_statistics(self, cr, uid, ids, name, arg, context=None):
|
def _get_statistics(self, cr, uid, ids, name, arg, context=None):
|
||||||
""" Compute statistics of the mass mailing campaign """
|
""" Compute statistics of the mass mailing campaign """
|
||||||
|
Statistics = self.pool['mail.mail.statistics']
|
||||||
results = dict.fromkeys(ids, False)
|
results = dict.fromkeys(ids, False)
|
||||||
for campaign in self.browse(cr, uid, ids, context=context):
|
for cid in ids:
|
||||||
results[campaign.id] = {
|
results[cid] = {
|
||||||
'sent': len(campaign.statistics_ids),
|
'total': Statistics.search(cr, uid, [('mass_mailing_campaign_id', '=', cid)], count=True, context=context),
|
||||||
# delivered: shouldn't be: all mails - (failed + bounced) ?
|
'sent': Statistics.search(cr, uid, [('mass_mailing_campaign_id', '=', cid), ('sent', '!=', False)], count=True, context=context),
|
||||||
'delivered': len([stat for stat in campaign.statistics_ids if not stat.bounced]), # stat.state == 'sent' and
|
'opened': Statistics.search(cr, uid, [('mass_mailing_campaign_id', '=', cid), ('opened', '!=', False)], count=True, context=context),
|
||||||
'opened': len([stat for stat in campaign.statistics_ids if stat.opened]),
|
'replied': Statistics.search(cr, uid, [('mass_mailing_campaign_id', '=', cid), ('replied', '!=', False)], count=True, context=context),
|
||||||
'replied': len([stat for stat in campaign.statistics_ids if stat.replied]),
|
'bounced': Statistics.search(cr, uid, [('mass_mailing_campaign_id', '=', cid), ('bounced', '!=', False)], count=True, context=context),
|
||||||
'bounced': len([stat for stat in campaign.statistics_ids if stat.bounced]),
|
|
||||||
}
|
}
|
||||||
return results
|
results[cid]['delivered'] = results[cid]['sent'] - results[cid]['bounced']
|
||||||
|
|
||||||
def _get_mass_mailing_kanban_ids(self, cr, uid, ids, name, arg, context=None):
|
|
||||||
""" Gather data about mass mailings to display them in kanban view as
|
|
||||||
nested kanban views is not possible currently. """
|
|
||||||
results = dict.fromkeys(ids, '')
|
|
||||||
for campaign in self.browse(cr, uid, ids, context=context):
|
|
||||||
mass_mailing_results = []
|
|
||||||
for mass_mailing in campaign.mass_mailing_ids[:self._kanban_mailing_nbr]:
|
|
||||||
mass_mailing_object = {}
|
|
||||||
for attr in ['name', 'sent', 'delivered', 'opened', 'replied', 'bounced']:
|
|
||||||
mass_mailing_object[attr] = getattr(mass_mailing, attr)
|
|
||||||
mass_mailing_results.append(mass_mailing_object)
|
|
||||||
results[campaign.id] = mass_mailing_results
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def _get_state_list(self, cr, uid, context=None):
|
def _get_state_list(self, cr, uid, context=None):
|
||||||
|
@ -211,16 +198,12 @@ class MassMailingCampaign(osv.Model):
|
||||||
_state = lambda self, *args, **kwargs: self._get_state_list(*args, **kwargs)
|
_state = lambda self, *args, **kwargs: self._get_state_list(*args, **kwargs)
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char(
|
'name': fields.char('Name', required=True),
|
||||||
'Campaign Name', required=True,
|
'state': fields.selection(_state, string='Status', required=True),
|
||||||
),
|
|
||||||
'user_id': fields.many2one(
|
'user_id': fields.many2one(
|
||||||
'res.users', 'Responsible',
|
'res.users', 'Responsible',
|
||||||
required=True,
|
required=True,
|
||||||
),
|
),
|
||||||
'state': fields.selection(
|
|
||||||
_state, string='Status', required=True,
|
|
||||||
),
|
|
||||||
'category_id': fields.many2one(
|
'category_id': fields.many2one(
|
||||||
'mail.mass_mailing.category', 'Category',
|
'mail.mass_mailing.category', 'Category',
|
||||||
help='Category'),
|
help='Category'),
|
||||||
|
@ -228,42 +211,34 @@ class MassMailingCampaign(osv.Model):
|
||||||
'mail.mass_mailing', 'mass_mailing_campaign_id',
|
'mail.mass_mailing', 'mass_mailing_campaign_id',
|
||||||
'Mass Mailings',
|
'Mass Mailings',
|
||||||
),
|
),
|
||||||
'mass_mailing_kanban_ids': fields.function(
|
|
||||||
_get_mass_mailing_kanban_ids,
|
|
||||||
type='text', string='Mass Mailings (kanban data)',
|
|
||||||
help='This field has for purpose to gather data about mass mailings '
|
|
||||||
'to display them in kanban view as nested kanban views is not '
|
|
||||||
'possible currently',
|
|
||||||
),
|
|
||||||
'statistics_ids': fields.one2many(
|
'statistics_ids': fields.one2many(
|
||||||
'mail.mail.statistics', 'mass_mailing_campaign_id',
|
'mail.mail.statistics', 'mass_mailing_campaign_id',
|
||||||
'Sent Emails',
|
'Sent Emails',
|
||||||
),
|
),
|
||||||
'color': fields.integer('Color Index'),
|
'color': fields.integer('Color Index'),
|
||||||
# stat fields
|
# stat fields
|
||||||
|
'total': fields.function(
|
||||||
|
_get_statistics, string='Scheduled',
|
||||||
|
type='integer', multi='_get_statistics'
|
||||||
|
),
|
||||||
'sent': fields.function(
|
'sent': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Sent Emails',
|
||||||
string='Sent Emails',
|
|
||||||
type='integer', multi='_get_statistics'
|
type='integer', multi='_get_statistics'
|
||||||
),
|
),
|
||||||
'delivered': fields.function(
|
'delivered': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Delivered',
|
||||||
string='Delivered',
|
|
||||||
type='integer', multi='_get_statistics',
|
type='integer', multi='_get_statistics',
|
||||||
),
|
),
|
||||||
'opened': fields.function(
|
'opened': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Opened',
|
||||||
string='Opened',
|
|
||||||
type='integer', multi='_get_statistics',
|
type='integer', multi='_get_statistics',
|
||||||
),
|
),
|
||||||
'replied': fields.function(
|
'replied': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Replied',
|
||||||
string='Replied',
|
|
||||||
type='integer', multi='_get_statistics'
|
type='integer', multi='_get_statistics'
|
||||||
),
|
),
|
||||||
'bounced': fields.function(
|
'bounced': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Bounced',
|
||||||
string='Bounced',
|
|
||||||
type='integer', multi='_get_statistics'
|
type='integer', multi='_get_statistics'
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
@ -306,21 +281,15 @@ class MassMailingCampaign(osv.Model):
|
||||||
# Actions
|
# Actions
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
|
|
||||||
def launch_mass_mailing_create_wizard(self, cr, uid, ids, context=None):
|
def action_new_mailing(self, cr, uid, ids, context=None):
|
||||||
ctx = dict(context)
|
|
||||||
ctx.update({
|
|
||||||
'default_mass_mailing_campaign_id': ids[0],
|
|
||||||
})
|
|
||||||
return {
|
return {
|
||||||
'name': _('Create a Mass Mailing for the Campaign'),
|
'name': _('Create a Mass Mailing for the Campaign'),
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form',
|
'view_mode': 'form',
|
||||||
'res_model': 'mail.mass_mailing.create',
|
'res_model': 'mail.mass_mailing',
|
||||||
'views': [(False, 'form')],
|
'views': [(False, 'form')],
|
||||||
'view_id': False,
|
'context': dict(context, default_mass_mailing_campaign_id=ids[0]),
|
||||||
'target': 'new',
|
|
||||||
'context': ctx,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -383,15 +352,17 @@ class MassMailing(osv.Model):
|
||||||
|
|
||||||
def _get_statistics(self, cr, uid, ids, name, arg, context=None):
|
def _get_statistics(self, cr, uid, ids, name, arg, context=None):
|
||||||
""" Compute statistics of the mass mailing campaign """
|
""" Compute statistics of the mass mailing campaign """
|
||||||
|
Statistics = self.pool['mail.mail.statistics']
|
||||||
results = dict.fromkeys(ids, False)
|
results = dict.fromkeys(ids, False)
|
||||||
for mass_mailing in self.browse(cr, uid, ids, context=context):
|
for mid in ids:
|
||||||
results[mass_mailing.id] = {
|
results[mid] = {
|
||||||
'sent': len(mass_mailing.statistics_ids),
|
'total': Statistics.search(cr, uid, [('mass_mailing_id', '=', mid)], count=True, context=context),
|
||||||
'delivered': len([stat for stat in mass_mailing.statistics_ids if not stat.bounced]), # mail.state == 'sent' and
|
'sent': Statistics.search(cr, uid, [('mass_mailing_id', '=', mid), ('sent', '!=', False)], count=True, context=context),
|
||||||
'opened': len([stat for stat in mass_mailing.statistics_ids if stat.opened]),
|
'opened': Statistics.search(cr, uid, [('mass_mailing_id', '=', mid), ('opened', '!=', False)], count=True, context=context),
|
||||||
'replied': len([stat for stat in mass_mailing.statistics_ids if stat.replied]),
|
'replied': Statistics.search(cr, uid, [('mass_mailing_id', '=', mid), ('replied', '!=', False)], count=True, context=context),
|
||||||
'bounced': len([stat for stat in mass_mailing.statistics_ids if stat.bounced]),
|
'bounced': Statistics.search(cr, uid, [('mass_mailing_id', '=', mid), ('bounced', '!=', False)], count=True, context=context),
|
||||||
}
|
}
|
||||||
|
results[mid]['delivered'] = results[mid]['sent'] - results[mid]['bounced']
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def _get_mailing_type(self, cr, uid, context=None):
|
def _get_mailing_type(self, cr, uid, context=None):
|
||||||
|
@ -447,41 +418,38 @@ class MassMailing(osv.Model):
|
||||||
'mail.mail.statistics', 'mass_mailing_id',
|
'mail.mail.statistics', 'mass_mailing_id',
|
||||||
'Emails Statistics',
|
'Emails Statistics',
|
||||||
),
|
),
|
||||||
|
'total': fields.function(
|
||||||
|
_get_statistics, string='Scheduled',
|
||||||
|
type='integer', multi='_get_statistics'
|
||||||
|
),
|
||||||
'sent': fields.function(
|
'sent': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Sent',
|
||||||
string='Sent Emails',
|
|
||||||
type='integer', multi='_get_statistics'
|
type='integer', multi='_get_statistics'
|
||||||
),
|
),
|
||||||
'delivered': fields.function(
|
'delivered': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Delivered',
|
||||||
string='Delivered',
|
|
||||||
type='integer', multi='_get_statistics',
|
type='integer', multi='_get_statistics',
|
||||||
),
|
),
|
||||||
'opened': fields.function(
|
'opened': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Opened',
|
||||||
string='Opened',
|
|
||||||
type='integer', multi='_get_statistics',
|
type='integer', multi='_get_statistics',
|
||||||
),
|
),
|
||||||
'replied': fields.function(
|
'replied': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Replied',
|
||||||
string='Replied',
|
|
||||||
type='integer', multi='_get_statistics'
|
type='integer', multi='_get_statistics'
|
||||||
),
|
),
|
||||||
'bounced': fields.function(
|
'bounced': fields.function(
|
||||||
_get_statistics,
|
_get_statistics, string='Bounced',
|
||||||
string='Bounce',
|
|
||||||
type='integer', multi='_get_statistics'
|
type='integer', multi='_get_statistics'
|
||||||
),
|
),
|
||||||
# monthly ratio
|
# monthly ratio
|
||||||
'opened_dayly': fields.function(
|
'opened_dayly': fields.function(
|
||||||
_get_daily_statistics,
|
_get_daily_statistics, string='Opened',
|
||||||
string='Opened',
|
|
||||||
type='char', multi='_get_daily_statistics',
|
type='char', multi='_get_daily_statistics',
|
||||||
oldname='opened_monthly',
|
oldname='opened_monthly',
|
||||||
),
|
),
|
||||||
'replied_dayly': fields.function(
|
'replied_dayly': fields.function(
|
||||||
_get_daily_statistics,
|
_get_daily_statistics, string='Replied',
|
||||||
string='Replied',
|
|
||||||
type='char', multi='_get_daily_statistics',
|
type='char', multi='_get_daily_statistics',
|
||||||
oldname='replied_monthly',
|
oldname='replied_monthly',
|
||||||
),
|
),
|
||||||
|
@ -673,6 +641,9 @@ class MailMailStats(osv.Model):
|
||||||
store=True, readonly=True,
|
store=True, readonly=True,
|
||||||
),
|
),
|
||||||
# Bounce and tracking
|
# Bounce and tracking
|
||||||
|
'sent': fields.datetime(
|
||||||
|
'Sent',
|
||||||
|
help='Date the related email was sent'),
|
||||||
'opened': fields.datetime(
|
'opened': fields.datetime(
|
||||||
'Opened',
|
'Opened',
|
||||||
help='Date when this email has been opened for the first time.'),
|
help='Date when this email has been opened for the first time.'),
|
||||||
|
@ -688,38 +659,29 @@ class MailMailStats(osv.Model):
|
||||||
def set_opened(self, cr, uid, ids=None, mail_mail_ids=None, mail_message_ids=None, context=None):
|
def set_opened(self, cr, uid, ids=None, mail_mail_ids=None, mail_message_ids=None, context=None):
|
||||||
""" Set as opened """
|
""" Set as opened """
|
||||||
if not ids and mail_mail_ids:
|
if not ids and mail_mail_ids:
|
||||||
ids = self.search(cr, uid, [('mail_mail_id', 'in', mail_mail_ids)], context=context)
|
ids = self.search(cr, uid, [('mail_mail_id', 'in', mail_mail_ids), ('opened', '=', False)], context=context)
|
||||||
elif not ids and mail_message_ids:
|
elif not ids and mail_message_ids:
|
||||||
ids = self.search(cr, uid, [('message_id', 'in', mail_message_ids)], context=context)
|
ids = self.search(cr, uid, [('message_id', 'in', mail_message_ids), ('opened', '=', False)], context=context)
|
||||||
else:
|
else:
|
||||||
ids = []
|
ids = self.search(cr, uid, [('id', 'in', ids or []), ('opened', '=', False)], context=context)
|
||||||
for stat in self.browse(cr, uid, ids, context=context):
|
return self.write(cr, uid, ids, {'opened': fields.datetime.now()}, context=context)
|
||||||
if not stat.opened:
|
|
||||||
self.write(cr, uid, [stat.id], {'opened': fields.datetime.now()}, context=context)
|
|
||||||
return ids
|
|
||||||
|
|
||||||
def set_replied(self, cr, uid, ids=None, mail_mail_ids=None, mail_message_ids=None, context=None):
|
def set_replied(self, cr, uid, ids=None, mail_mail_ids=None, mail_message_ids=None, context=None):
|
||||||
""" Set as replied """
|
""" Set as replied """
|
||||||
if not ids and mail_mail_ids:
|
if not ids and mail_mail_ids:
|
||||||
ids = self.search(cr, uid, [('mail_mail_id', 'in', mail_mail_ids)], context=context)
|
ids = self.search(cr, uid, [('mail_mail_id', 'in', mail_mail_ids), ('replied', '=', False)], context=context)
|
||||||
elif not ids and mail_message_ids:
|
elif not ids and mail_message_ids:
|
||||||
ids = self.search(cr, uid, [('message_id', 'in', mail_message_ids)], context=context)
|
ids = self.search(cr, uid, [('message_id', 'in', mail_message_ids), ('replied', '=', False)], context=context)
|
||||||
else:
|
else:
|
||||||
ids = []
|
ids = self.search(cr, uid, [('id', 'in', ids or []), ('replied', '=', False)], context=context)
|
||||||
for stat in self.browse(cr, uid, ids, context=context):
|
return self.write(cr, uid, ids, {'replied': fields.datetime.now()}, context=context)
|
||||||
if not stat.replied:
|
|
||||||
self.write(cr, uid, [stat.id], {'replied': fields.datetime.now()}, context=context)
|
|
||||||
return ids
|
|
||||||
|
|
||||||
def set_bounced(self, cr, uid, ids=None, mail_mail_ids=None, mail_message_ids=None, context=None):
|
def set_bounced(self, cr, uid, ids=None, mail_mail_ids=None, mail_message_ids=None, context=None):
|
||||||
""" Set as bounced """
|
""" Set as bounced """
|
||||||
if not ids and mail_mail_ids:
|
if not ids and mail_mail_ids:
|
||||||
ids = self.search(cr, uid, [('mail_mail_id', 'in', mail_mail_ids)], context=context)
|
ids = self.search(cr, uid, [('mail_mail_id', 'in', mail_mail_ids), ('bounced', '=', False)], context=context)
|
||||||
elif not ids and mail_message_ids:
|
elif not ids and mail_message_ids:
|
||||||
ids = self.search(cr, uid, [('message_id', 'in', mail_message_ids)], context=context)
|
ids = self.search(cr, uid, [('message_id', 'in', mail_message_ids), ('bounced', '=', False)], context=context)
|
||||||
else:
|
else:
|
||||||
ids = []
|
ids = self.search(cr, uid, [('id', 'in', ids or []), ('bounced', '=', False)], context=context)
|
||||||
for stat in self.browse(cr, uid, ids, context=context):
|
return self.write(cr, uid, ids, {'bounced': fields.datetime.now()}, context=context)
|
||||||
if not stat.bounced:
|
|
||||||
self.write(cr, uid, [stat.id], {'bounced': fields.datetime.now()}, context=context)
|
|
||||||
return ids
|
|
||||||
|
|
|
@ -1,61 +1,17 @@
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing.oe_kanban_mass_mailing_campaign {
|
.openerp .oe_kanban_view .oe_kanban_mass_mailing_campaign {
|
||||||
/* Customize to manage content */
|
/* Customize to manage content */
|
||||||
width: 552px;
|
width: 360px;
|
||||||
min-height: 278px !important;
|
min-height: 254px !important;
|
||||||
/* End of customize */
|
/* End of customize */
|
||||||
}
|
}
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing.oe_kanban_mass_mailing_segment {
|
.openerp .oe_kanban_view .oe_kanban_mass_mailing_campaign .oe_kanban_header_right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openerp .oe_kanban_view .oe_kanban_mass_mailing {
|
||||||
/* Customize to manage content */
|
/* Customize to manage content */
|
||||||
width: 282px;
|
width: 280px;
|
||||||
min-height: 246px !important;
|
min-height: 150px !important;
|
||||||
/* End of customize */
|
/* End of customize */
|
||||||
}
|
}
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing .oe_mail_stats {
|
|
||||||
width: 122px; /* Manage space in between stats */
|
|
||||||
display: inline-block;
|
|
||||||
margin: 2px 5px 0px 5px;
|
|
||||||
text-align: center;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.16);
|
|
||||||
-webkit-border-radius: 2px;
|
|
||||||
border-radius: 2px;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing .oe_mail_result {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing .oe_gauge {
|
|
||||||
width: 120px;
|
|
||||||
height: 120px;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing .oe_kanban_content div.oe_sparkline_container {
|
|
||||||
height: 60px;
|
|
||||||
width: 120px;
|
|
||||||
display: inline-block;
|
|
||||||
margin: 8px 5px 0px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing .oe_sparkline_bar_title {
|
|
||||||
text-align: center;
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.openerp .oe_kanban_view .oe_kanban_mass_mailing .oe_sparkline_bar {
|
|
||||||
width: 100px;
|
|
||||||
height: 60px;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Campaign related CSS
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Segment related CSS
|
|
||||||
*/
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ openerp.mass_mailing = function(openerp) {
|
||||||
openerp.web_kanban.KanbanRecord.include({
|
openerp.web_kanban.KanbanRecord.include({
|
||||||
on_card_clicked: function (event) {
|
on_card_clicked: function (event) {
|
||||||
if (this.view.dataset.model === 'mail.mass_mailing.campaign') {
|
if (this.view.dataset.model === 'mail.mass_mailing.campaign') {
|
||||||
this.$('.oe_mass_mailings a').first().click();
|
this.$('.oe_mailings').click();
|
||||||
} else {
|
} else {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,47 +253,27 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<kanban default_group_by='state'>
|
<kanban default_group_by='state'>
|
||||||
<field name='color'/>
|
<field name='color'/>
|
||||||
|
<field name='total'/>
|
||||||
<templates>
|
<templates>
|
||||||
<t t-name="kanban-box">
|
<t t-name="kanban-box">
|
||||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_kanban_mass_mailing oe_kanban_mass_mailing_segment">
|
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_kanban_mass_mailing">
|
||||||
<div class="oe_kanban_content">
|
<div class="oe_kanban_content">
|
||||||
<div>
|
<div>
|
||||||
<h3>
|
<h3><field name="name"/></h3>
|
||||||
<field name="name"/>
|
<h4 style="display: inline;"><field name="mass_mailing_campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/></h4>
|
||||||
</h3>
|
<t t-if="record.mass_mailing_campaign_id.raw_value"> - </t><field name="date"/>
|
||||||
<p style="margin-left: 10px; margin-top: 8px;">
|
|
||||||
<span>Sent:</span><field name="date"/><br />
|
|
||||||
<span groups="mass_mailing.mass_mailing_campaign_id">Campaign:</span>
|
|
||||||
<field name="mass_mailing_campaign_id" groups="mass_mailing.mass_mailing_campaign_id"/>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p class="oe_mail_stats">
|
<field name="total" widget="gauge" style="width:120px; height: 90px;"
|
||||||
<span class="oe_mail_result"><field name="sent"/></span><br />
|
options="{'max_field': 'total'}"/>
|
||||||
Sent
|
<field name="delivered" widget="gauge" style="width:120px; height: 90px;"
|
||||||
</p>
|
options="{'max_field': 'total'}"/>
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><field name="delivered"/></span><br />
|
|
||||||
Delivered
|
|
||||||
</p>
|
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><field name="opened"/></span><br />
|
|
||||||
Opened
|
|
||||||
</p>
|
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><field name="replied"/></span><br />
|
|
||||||
Replied
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="oe_sparkline_container">
|
<field name="opened" widget="gauge" style="width:120px; height: 90px;"
|
||||||
<h4 class="oe_sparkline_bar_title">Opened</h4><br />
|
options="{'max_field': 'total'}"/>
|
||||||
<field name="opened_dayly" widget="sparkline_bar" options="{'height': '50px', 'barWidth': 10, 'barSpacing': 5}"/>
|
<field name="replied" widget="gauge" style="width:120px; height: 90px;"
|
||||||
</div>
|
options="{'max_field': 'total'}"/>
|
||||||
<div class="oe_sparkline_container">
|
|
||||||
<h4 class="oe_sparkline_bar_title">Replied</h4><br />
|
|
||||||
<field name="replied_dayly" widget="sparkline_bar" options="{'height': '50px', 'barWidth': 10, 'barSpacing': 5}"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_clear"></div>
|
<div class="oe_clear"></div>
|
||||||
|
@ -366,27 +346,20 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Mass Mailing Campaign" version="7.0">
|
<form string="Mass Mailing Campaign" version="7.0">
|
||||||
<header>
|
<header>
|
||||||
<button name="launch_mass_mailing_create_wizard" type="object"
|
<button name="action_new_mailing" type="object" class="oe_highlight" string="New Mailing"/>
|
||||||
class="oe_highlight" string="New Mailing"/>
|
|
||||||
<field name="state" widget="statusbar" clickable="True"/>
|
<field name="state" widget="statusbar" clickable="True"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<group>
|
<group>
|
||||||
<field name="name"/>
|
<group>
|
||||||
<field name="user_id"/>
|
<field name="name"/>
|
||||||
<field name="category_id"/>
|
<field name="user_id"/>
|
||||||
|
<field name="category_id"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
here be some graphs
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<!-- <group>
|
|
||||||
<group>
|
|
||||||
<field name="sent"/>
|
|
||||||
<field name="opened"/>
|
|
||||||
<field name="bounced"/>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<field name="delivered"/>
|
|
||||||
<field name="replied"/>
|
|
||||||
</group>
|
|
||||||
</group> -->
|
|
||||||
<group>
|
<group>
|
||||||
<field name="mass_mailing_ids" readonly="1" string="Related Mailing(s)">
|
<field name="mass_mailing_ids" readonly="1" string="Related Mailing(s)">
|
||||||
<tree>
|
<tree>
|
||||||
|
@ -411,39 +384,13 @@
|
||||||
<field name="model">mail.mass_mailing.campaign</field>
|
<field name="model">mail.mass_mailing.campaign</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<kanban default_group_by='state'>
|
<kanban default_group_by='state'>
|
||||||
<field name="mass_mailing_kanban_ids"/>
|
<field name='total'/>
|
||||||
<field name='sent'/>
|
|
||||||
<field name='color'/>
|
<field name='color'/>
|
||||||
|
<field name='user_id'/>
|
||||||
|
<field name='mass_mailing_ids'/>
|
||||||
<templates>
|
<templates>
|
||||||
<t t-name="mass_mailing.mass_mailing">
|
|
||||||
<div class="oe_mass_mailings">
|
|
||||||
<div>
|
|
||||||
<a name="%(action_view_mass_mailings_from_campaign)d" type="action">
|
|
||||||
<h4><t t-raw="mass_mailing.name"/></h4>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><t t-raw="mass_mailing.sent"/></span><br />
|
|
||||||
Sent
|
|
||||||
</p>
|
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><t t-raw="mass_mailing.delivered"/></span><br />
|
|
||||||
Delivered
|
|
||||||
</p>
|
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><t t-raw="mass_mailing.opened"/></span><br />
|
|
||||||
Opened
|
|
||||||
</p>
|
|
||||||
<p class="oe_mail_stats">
|
|
||||||
<span class="oe_mail_result"><t t-raw="mass_mailing.replied"/></span><br />
|
|
||||||
Replied
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</t>
|
|
||||||
<t t-name="kanban-box">
|
<t t-name="kanban-box">
|
||||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_kanban_mass_mailing oe_kanban_mass_mailing_campaign">
|
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_kanban_mass_mailing_campaign">
|
||||||
<div class="oe_dropdown_toggle oe_dropdown_kanban">
|
<div class="oe_dropdown_toggle oe_dropdown_kanban">
|
||||||
<span class="oe_e">i</span>
|
<span class="oe_e">i</span>
|
||||||
<ul class="oe_dropdown_menu">
|
<ul class="oe_dropdown_menu">
|
||||||
|
@ -457,20 +404,31 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_kanban_content">
|
<div class="oe_kanban_content">
|
||||||
<h3>
|
|
||||||
<field name="name"/>
|
|
||||||
</h3>
|
|
||||||
<div>
|
<div>
|
||||||
<field name="delivered" widget="gauge" style="width:160px; height: 120px;"
|
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)"
|
||||||
options="{'max_field': 'sent'}"/>
|
t-att-title="record.user_id.value" width="48" height="48o" class="oe_kanban_avatar oe_kanban_header_right"/>
|
||||||
<field name="opened" widget="gauge" style="width:160px; height: 120px;"
|
<h3>
|
||||||
options="{'max_field': 'sent'}"/>
|
<field name="name"/>
|
||||||
<field name="replied" widget="gauge" style="width:160px; height: 120px;"
|
</h3>
|
||||||
options="{'max_field': 'sent'}"/>
|
<span class="oe_tag"><field name="category_id"/></span>
|
||||||
|
<a name="%(action_view_mass_mailings_from_campaign)d" type="action"
|
||||||
|
class="oe_mailings">
|
||||||
|
<h4><t t-raw="record.mass_mailing_ids.raw_value.length"/> Mailings</h4>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="oe_clear"></div>
|
||||||
|
<div>
|
||||||
|
<field name="total" widget="gauge" style="width:160px; height: 120px;"
|
||||||
|
options="{'max_field': 'total'}"/>
|
||||||
|
<field name="delivered" widget="gauge" style="width:160px; height: 120px;"
|
||||||
|
options="{'max_field': 'total'}"/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<field name="opened" widget="gauge" style="width:160px; height: 120px;"
|
||||||
|
options="{'max_field': 'total'}"/>
|
||||||
|
<field name="replied" widget="gauge" style="width:160px; height: 120px;"
|
||||||
|
options="{'max_field': 'total'}"/>
|
||||||
</div>
|
</div>
|
||||||
<t t-foreach='record.mass_mailing_kanban_ids.value' t-as='mass_mailing'>
|
|
||||||
<t t-call="mass_mailing.mass_mailing"/>
|
|
||||||
</t>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_clear"></div>
|
<div class="oe_clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue