Browse Source

[FIX] error with empty author_id

pull/1/head
Ivan Yelizariev 9 years ago
parent
commit
76bb7351c7
  1. 2
      __openerp__.py
  2. 2
      models.py

2
__openerp__.py

@ -1,6 +1,6 @@
{ {
'name' : 'Sentbox', 'name' : 'Sentbox',
'version' : '1.0.0',
'version' : '1.0.1',
'author' : 'IT-Projects LLC, Ivan Yelizariev', 'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
'category' : 'Social Network', 'category' : 'Social Network',

2
models.py

@ -6,7 +6,7 @@ class mail_message(models.Model):
@api.one @api.one
@api.depends('author_id', 'notified_partner_ids') @api.depends('author_id', 'notified_partner_ids')
def _get_sent(self): 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) sent = fields.Boolean('Sent', compute=_get_sent, help='Was message sent to someone', store=True)

Loading…
Cancel
Save