[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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user