diff options
| author | Thibault Delavallée <tde@odoo.com> | 2017-09-12 16:39:26 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2017-09-15 15:56:23 +0200 |
| commit | ae455fb1f5bf6ec2238f6fd65f697de4f7c9a4f8 (patch) | |
| tree | 63d475f231fe0322022c94313169c27dec2bc582 | |
| parent | 7accd77999ebcd4ce16388f2a23ee296093fecbc (diff) | |
[FIX] mass_mailing: fix issue in _get_mailing_model
getattr crashes and in this case we probably meant to use hasattr as we
have a fallback behavior.
| -rw-r--r-- | addons/mass_mailing/models/mass_mailing.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index a2560657ce8..147f5447545 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -295,7 +295,7 @@ class MassMailing(models.Model): for model_name in self.env: model = self.env[model_name] if hasattr(model, '_mail_mass_mailing') and getattr(model, '_mail_mass_mailing'): - if getattr(model, 'message_mass_mailing_enabled'): + if hasattr(model, 'message_mass_mailing_enabled'): res.append((model._name, model.message_mass_mailing_enabled())) else: res.append((model._name, model._mail_mass_mailing)) |
