From 3eae2ce899fff83c1664117ef60e442cf9a26bbb Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Fri, 18 Mar 2016 12:17:51 +0500 Subject: [PATCH] mail_sent: fix #90 --- models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models.py b/models.py index 2f9257b..38c82e9 100644 --- a/models.py +++ b/models.py @@ -7,7 +7,8 @@ class mail_message(models.Model): @api.one @api.depends('author_id', 'notified_partner_ids') def _get_sent(self): - self.sent = len(self.notified_partner_ids) > 1 or len(self.notified_partner_ids) == 1 and self.author_id and self.notified_partner_ids[0].id != self.author_id.id + self_sudo = self.sudo() + self_sudo.sent = len(self_sudo.notified_partner_ids) > 1 or len(self_sudo.notified_partner_ids) == 1 and self_sudo.author_id and self_sudo.notified_partner_ids[0].id != self_sudo.author_id.id sent = fields.Boolean('Sent', compute=_get_sent, help='Was message sent to someone', store=True)