[FIX] mail: wrong many2many definition

The definition of `attachment_ids` on model `email_template.preview` is wrong,
because its table/columns refer to the model `mail.template`.  As the field is
only used to preview a result in a wizard form, it does not need to be stored.

closes odoo/odoo#29349
This commit is contained in:
Raphael Collet
2018-12-07 12:28:58 +00:00
parent 23d9aeb22d
commit 54238c88e8
2 changed files with 3 additions and 0 deletions
@@ -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
+2
View File
@@ -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)