From fbc5312c790503de5ba1777a6ff6fa37bab2d96f Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 1 Jun 2017 09:52:45 +0200 Subject: [PATCH] [FIX] crm, mail, mass_mailing: default bounce Set a default bounce to zero. Otherwise, if not set, filtering on the number of bounces doesn't work correctly. opw-744558 --- addons/crm/models/crm_lead.py | 2 +- addons/mail/models/res_partner.py | 2 +- addons/mass_mailing/models/mass_mailing.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 2d45d6b6801..a7f4ff77290 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -106,7 +106,7 @@ class Lead(models.Model): date_conversion = fields.Datetime('Conversion Date', readonly=True) # Messaging and marketing - message_bounce = fields.Integer('Bounce', help="Counter of the number of bounced emails for this contact") + message_bounce = fields.Integer('Bounce', help="Counter of the number of bounced emails for this contact", default=0) # Only used for type opportunity probability = fields.Float('Probability', group_operator="avg", default=lambda self: self._default_probability()) diff --git a/addons/mail/models/res_partner.py b/addons/mail/models/res_partner.py index b46a29e83af..2ef3f6508b6 100644 --- a/addons/mail/models/res_partner.py +++ b/addons/mail/models/res_partner.py @@ -18,7 +18,7 @@ class Partner(models.Model): _mail_flat_thread = False _mail_mass_mailing = _('Customers') - message_bounce = fields.Integer('Bounce', help="Counter of the number of bounced emails for this contact") + message_bounce = fields.Integer('Bounce', help="Counter of the number of bounced emails for this contact", default=0) opt_out = fields.Boolean( 'Opt-Out', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing.") diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index 2c1b716420f..7e31fb75870 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -77,7 +77,7 @@ class MassMailingContact(models.Model): 'contact_id', 'list_id', string='Mailing Lists') opt_out = fields.Boolean(string='Opt Out', help='The contact has chosen not to receive mails anymore from this list') unsubscription_date = fields.Datetime(string='Unsubscription Date') - message_bounce = fields.Integer(string='Bounced', help='Counter of the number of bounced emails for this contact.') + message_bounce = fields.Integer(string='Bounced', help='Counter of the number of bounced emails for this contact.', default=0) country_id = fields.Many2one('res.country', string='Country') tag_ids = fields.Many2many('res.partner.category', string='Tags')