From 1d56ea0f6fead777df34bb311a84adb0468faa44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Wed, 9 Sep 2015 16:36:55 +0200 Subject: [PATCH] [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 --- addons/mail/models/mail_channel.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index 6a2c99c0b14..91937470ed8 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -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]