summaryrefslogtreecommitdiff
path: root/addons/mail/security/mail_security.xml
diff options
context:
space:
mode:
authorDebauche Stéphane <std@odoo.com>2020-11-19 18:53:52 +0100
committerDebauche Stéphane <std@odoo.com>2020-11-19 18:53:52 +0100
commiteda542c82f84d7b5589846691b9cb6b7f1021947 (patch)
treedc7c7e14a874cba7d09ffc3a4db3247c4abb1667 /addons/mail/security/mail_security.xml
parent88e5d2df8d8d56881003320cbebaf95ed9ca7101 (diff)
[FIX] mail: make the current user member of the created channel
Purpose ======= Before, by default, if a user create a channel, he will not be member of this channel. After, the current user will always be member of the new channel. Task 1963414
Diffstat (limited to 'addons/mail/security/mail_security.xml')
-rw-r--r--addons/mail/security/mail_security.xml14
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/mail/security/mail_security.xml b/addons/mail/security/mail_security.xml
index 565af06b20a..6aef7841d6d 100644
--- a/addons/mail/security/mail_security.xml
+++ b/addons/mail/security/mail_security.xml
@@ -13,6 +13,20 @@
<field name="perm_create" eval="False"/>
</record>
+ <record id="ir_rule_mail_channel_partner_group_user" model="ir.rule">
+ <field name="name">mail.channel.partner: write its own entries</field>
+ <field name="model_id" ref="model_mail_channel_partner"/>
+ <field name="groups" eval="[(4, ref('base.group_user')), (4, ref('base.group_portal'))]"/>
+ <field name="domain_force">['|', '|',
+('channel_id.public', '=', 'public'),
+'&amp;', ('channel_id.public', '=', 'private'), ('channel_id.channel_partner_ids', 'in', [user.partner_id.id]),
+'&amp;', ('channel_id.public', '=', 'groups'), ('channel_id.group_public_id', 'in', [g.id for g in user.groups_id])]</field>
+ <field name="perm_read" eval="False"/>
+ <field name="perm_write" eval="True"/>
+ <field name="perm_create" eval="False"/>
+ <field name="perm_unlink" eval="True"/>
+ </record>
+
<record id="ir_rule_mail_notifications_group_user" model="ir.rule">
<field name="name">mail.notifications: group_user: write its own entries</field>
<field name="model_id" ref="model_mail_notification"/>