[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.
This commit is contained in:
committed by
Yannick Tivisse
parent
7accd77999
commit
ae455fb1f5
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user