diff options
| author | Thibault Delavallée <tde@odoo.com> | 2019-07-17 09:26:42 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-07-17 15:39:06 +0000 |
| commit | 2896aad34e797b6ca65a8efe3c5d71f31500a9a2 (patch) | |
| tree | 81f2298b04182860e84f2ca9815f313cc0c75ffc /addons/mass_mailing/wizard/mail_compose_message.py | |
| parent | 20dfba6e11ac4553509c1a3516c6453b8f8023e7 (diff) | |
[REF] mass_mailing: rename mail.mail.statistics and reporting model
PURPOSE
Mass mailing is currently a bit messy. As SMS will be added as a way to notify
people in mass through SMS let us take this opportunity to somehow clean this
application: organization, light code cleaning, model renaming.
SPECIFICATIONS
Rename mail.mail.statistics to mailing.trace and mail.statistics.report
to mail.trace.report. Rationale :
* mail.mail.statistics is linked to mail.mail model. Soon this model will
hold data related to SMS sending. It makes sense to be broader in the
naming;
* mailing.trace is more inlined with marketing.trace model that is the
marketing automation model using it in marketing automation (enterprise
application);
* mailing.trace is shorter to write;
* mail.statistics.report model should sense to be updated at the same
time;
MIGRATION
mail.mail.statistics model -> mailing.trace
mail_mail_statistics table -> mailing_trace
mail.statistics.report model -> mail.trace.report
fields updated (w column change)
* link.tracker.click: mail_stat_id -> mailing_trace_id
fields updated (no column change)
* mail.mail: statistics_ids -> mailing_trace_ids
* mail.mass_mailing: statistics_ids -> mailing_trace_ids
LINKS
Task ID 2037906
Preparing task ID 1997464 (SMS addition in mass mailing)
PR #34938
Diffstat (limited to 'addons/mass_mailing/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mass_mailing/wizard/mail_compose_message.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py index 3f5c0c03e2e..fc75d7e192f 100644 --- a/addons/mass_mailing/wizard/mail_compose_message.py +++ b/addons/mass_mailing/wizard/mail_compose_message.py @@ -16,7 +16,7 @@ class MailComposeMessage(models.TransientModel): def get_mail_values(self, res_ids): """ Override method that generated the mail content by creating the - mail.mail.statistics values in the o2m of mail_mail, when doing pure + mailing.trace values in the o2m of mail_mail, when doing pure email mass mailing. """ self.ensure_one() res = super(MailComposeMessage, self).get_mail_values(res_ids) @@ -71,7 +71,7 @@ class MailComposeMessage(models.TransientModel): mail_values['state'] = 'cancel' elif seen_list is not None: seen_list.add(mail_to) - stat_vals = { + trace_vals = { 'model': self.model, 'res_id': res_id, 'mass_mailing_id': mass_mailing.id, @@ -79,12 +79,12 @@ class MailComposeMessage(models.TransientModel): } if mail_values.get('body_html') and mass_mail_layout: mail_values['body_html'] = mass_mail_layout.render({'body': mail_values['body_html']}, engine='ir.qweb', minimal_qcontext=True) - # propagate ignored state to stat when still-born + # propagate ignored state to trace when still-born if mail_values.get('state') == 'cancel': - stat_vals['ignored'] = fields.Datetime.now() + trace_vals['ignored'] = fields.Datetime.now() mail_values.update({ 'mailing_id': mass_mailing.id, - 'statistics_ids': [(0, 0, stat_vals)], + 'mailing_trace_ids': [(0, 0, trace_vals)], # email-mode: keep original message for routing 'notification': mass_mailing.reply_to_mode == 'thread', 'auto_delete': not mass_mailing.keep_archives, |
