[FIX] mail : when create a channel, give it the channel_last_seen_partner_ids to direct make the creator a member and avoid access right exception

This commit is contained in:
Jérome Maes
2015-09-14 10:16:32 +02:00
parent 762cc2dbfa
commit 1d56ea0f6f
+5 -2
View File
@@ -488,6 +488,9 @@ class Channel(models.Model):
:return dict : channel header
"""
# create the channel
new_channel = self.create({'name': name, 'public': privacy})
new_channel.action_follow()
new_channel = self.create({
'name': name,
'public': privacy,
'channel_last_seen_partner_ids': [(0, 0, {'partner_id': self.env.user.partner_id.id})]
})
return new_channel.channel_info()[0]