summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_message.py
diff options
context:
space:
mode:
authorJigar Patel <jat@openerp.com>2016-03-25 16:39:12 +0530
committerYannick Tivisse <yti@odoo.com>2016-04-08 13:41:01 +0200
commit253d4eccf0001c5ede843cb29c1ce4f69fc6fbd0 (patch)
tree0c53a3819a2984672c8261945e71e8bb6013b089 /addons/mail/models/mail_message.py
parente4ae6a80bb2d95a85d222d9012282919d5ebac0f (diff)
[IMP] mail: Add counter in starred
Diffstat (limited to 'addons/mail/models/mail_message.py')
-rw-r--r--addons/mail/models/mail_message.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 949cef23138..c054b6e10a3 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -237,14 +237,13 @@ class Message(models.Model):
self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), notification)
@api.multi
- def set_message_starred(self, starred):
- """ Set messages as (un)starred. Technically, the notifications related
+ def toggle_message_starred(self):
+ """ Toggle messages as (un)starred. Technically, the notifications related
to uid are set to (un)starred.
-
- :param bool starred: set notification as (un)starred
"""
# a user should always be able to star a message he can read
self.check_access_rule('read')
+ starred = not self.starred
if starred:
self.sudo().write({'starred_partner_ids': [(4, self.env.user.partner_id.id)]})
else: