diff --git a/addons/mail/wizard/email_template_preview.py b/addons/mail/wizard/email_template_preview.py index 678dbfa3ee5..a05badd0359 100644 --- a/addons/mail/wizard/email_template_preview.py +++ b/addons/mail/wizard/email_template_preview.py @@ -34,6 +34,7 @@ class TemplatePreview(models.TransientModel): res_id = fields.Selection(_get_records, 'Sample Document') partner_ids = fields.Many2many('res.partner', string='Recipients') + attachment_ids = fields.Many2many(string='Attachments', store=False) @api.onchange('res_id') @api.multi diff --git a/odoo/fields.py b/odoo/fields.py index b472e35658b..c1e11fef022 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -2329,6 +2329,8 @@ class Many2many(_RelationalMulti): self.column2 = '%s_id' % comodel._table # check validity of table name check_pg_name(self.relation) + else: + self.relation = self.column1 = self.column2 = None def _setup_regular_full(self, model): super(Many2many, self)._setup_regular_full(model)