Skip to content

Commit

Permalink
[IMP] mass_mailing: Fix traceback on onchange when removing recipient…
Browse files Browse the repository at this point in the history
…s model
  • Loading branch information
dbh-odoo authored and tivisse committed Sep 22, 2017
1 parent 858d06f commit a203eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/mass_mailing/models/mass_mailing.py
Expand Up @@ -445,7 +445,7 @@ def _onchange_model_and_list(self):
self.mailing_domain = "[('list_ids', 'in', [%s]), ('opt_out', '=', False)]" % (','.join(str(id) for id in self.contact_list_ids.ids),)
else:
self.mailing_domain = "[(0, '=', 1)]"
elif 'opt_out' in self.env[self.mailing_model_name]._fields and not self.mailing_domain:
elif self.mailing_model_name and 'opt_out' in self.env[self.mailing_model_name]._fields and not self.mailing_domain:
self.mailing_domain = "[('opt_out', '=', False)]"
self.body_html = "on_change_model_and_list"

Expand Down

0 comments on commit a203eac

Please sign in to comment.