[FIX] mail_thread inheritance: add api.returns on override of message_post
As message_post is defined on mail.thread abstract class its api.returns is not automatically added on overridden versions of the method. This commit add missing api.returns on all overrides of the method.
This commit is contained in:
@@ -31,6 +31,7 @@ class User(models.Model):
|
||||
return self.env['hr.employee'].with_context(ctx).search([('user_id', '=', self.id)])
|
||||
|
||||
@api.multi
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def message_post(self, **kwargs):
|
||||
""" Redirect the posting of message on res.users to the related employees.
|
||||
This is done because when giving the context of Chatter on the
|
||||
|
||||
@@ -77,6 +77,7 @@ class Users(models.Model):
|
||||
return self.partner_id.id
|
||||
|
||||
@api.multi
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def message_post(self, **kwargs):
|
||||
""" Redirect the posting of message on res.users as a private discussion.
|
||||
This is done because when giving the context of Chatter on the
|
||||
|
||||
@@ -33,6 +33,7 @@ class Blog(models.Model):
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def message_post(self, parent_id=False, subtype=None, **kwargs):
|
||||
""" Temporary workaround to avoid spam. If someone replies on a channel
|
||||
through the 'Presentation Published' email, it should be considered as a
|
||||
|
||||
@@ -799,6 +799,7 @@ class Post(models.Model):
|
||||
return groups
|
||||
|
||||
@api.multi
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def message_post(self, message_type='notification', subtype=None, **kwargs):
|
||||
question_followers = self.env['res.partner']
|
||||
if self.ids and message_type == 'comment': # user comments have a restriction on karma
|
||||
|
||||
@@ -165,6 +165,7 @@ class Channel(models.Model):
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def message_post(self, parent_id=False, subtype=None, **kwargs):
|
||||
""" Temporary workaround to avoid spam. If someone replies on a channel
|
||||
through the 'Presentation Published' email, it should be considered as a
|
||||
|
||||
Reference in New Issue
Block a user