From 76bb7351c73dbd58eff2e64983e80f3e0b4679bb Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 20 Jan 2016 17:46:31 +0500 Subject: [PATCH] [FIX] error with empty author_id --- __openerp__.py | 2 +- models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__openerp__.py b/__openerp__.py index a5cd98b..c90c467 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -1,6 +1,6 @@ { 'name' : 'Sentbox', - 'version' : '1.0.0', + 'version' : '1.0.1', 'author' : 'IT-Projects LLC, Ivan Yelizariev', 'license': 'GPL-3', 'category' : 'Social Network', diff --git a/models.py b/models.py index 27e0425..04cdf91 100644 --- a/models.py +++ b/models.py @@ -6,7 +6,7 @@ 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.notified_partner_ids[0].id != self.author_id.id + 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 sent = fields.Boolean('Sent', compute=_get_sent, help='Was message sent to someone', store=True)