[FIX] digest: fix m2m typo that would not do whats expected
m2m ORM operation (4, id, _) was not correctly used, resulting in an unexpected behavior. Instead of adding the record, it would add the record and also the res.user(4,). As that used is generally the public user, without an email address, that bug would not be that critical but if that res.user(4,) does not exist (eg deleted), then the code simply crash as it tries to read user 4 from db. closes odoo/odoo#32425 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -133,7 +133,7 @@ class Digest(models.Model):
|
||||
tip = self.env['digest.tip'].search([('user_ids', '!=', user.id), '|', ('group_id', 'in', user.groups_id.ids), ('group_id', '=', False)], limit=1)
|
||||
if not tip:
|
||||
return False
|
||||
tip.user_ids = [4, user.id]
|
||||
tip.user_ids += user
|
||||
body = tools.html_sanitize(tip.tip_description)
|
||||
tip_description = self.env['mail.template']._render_template(body, 'digest.tip', self.id)
|
||||
return tip_description
|
||||
|
||||
Reference in New Issue
Block a user