Browse Source

[IMP] "sent" field for mail.message

pull/2/head
Ivan Yelizariev 10 years ago
parent
commit
cfa6db94f7
  1. 1
      __init__.py
  2. 11
      models.py
  3. 1
      views.xml

1
__init__.py

@ -0,0 +1 @@
import models

11
models.py

@ -0,0 +1,11 @@
from openerp import api, models, fields, SUPERUSER_ID
class mail_message(models.Model):
_inherit = 'mail.message'
@api.one
@api.depends('author_id', 'notification_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
sent = fields.Boolean('Sent', compute=_get_sent, help='Was message sent to someone', store=True)

1
views.xml

@ -13,6 +13,7 @@
<field name="params" eval="&quot;{ <field name="params" eval="&quot;{
'domain': [ 'domain': [
('author_id.user_ids', 'in', [uid]), ('author_id.user_ids', 'in', [uid]),
('sent', '=', True),
], ],
'view_mailbox': True, 'view_mailbox': True,
'show_compose_message': False 'show_compose_message': False

Loading…
Cancel
Save