summaryrefslogtreecommitdiff
path: root/addons/digest/models/digest.py
diff options
context:
space:
mode:
authorJalpesh Patel <pja@openerp.com>2019-04-04 13:18:17 +0000
committerJalpesh Patel <pja@openerp.com>2019-04-08 09:30:41 +0000
commite524a2500448ff9a1cfcc8765601754f7ae6180c (patch)
treee33f3db4b92b95289f25317333fe2349f31b6ab9 /addons/digest/models/digest.py
parentfef49061ead4a437bac922d9d32270f76addd014 (diff)
[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>
Diffstat (limited to 'addons/digest/models/digest.py')
-rw-r--r--addons/digest/models/digest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/digest/models/digest.py b/addons/digest/models/digest.py
index 1283a5a241c..b3fd27a6284 100644
--- a/addons/digest/models/digest.py
+++ b/addons/digest/models/digest.py
@@ -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