Rationale ========= Currently, mail channels have 2 modes - They can be used like Discuss channel (chat, livechat, group) - They can be used like a Mailing List (with the "email_send" field) The mix of both feature in the same model causes some code complexity. Several fields are not used in both cases (moderation related field) and the future "Discord like" Discuss will even push the mail channel further than the usage of the mailing list. Because of all those reasons, we want to split the 2 mains features of the mail channels into 2 different modules and models. Purpose ======= This commit remove the moderation feature of the mail channel (email_send=True). This will be re-implemented in a separate module in the next commit. Do not be able to check messages in Discuss anymore because this feature is only used to moderate the message and this feature will be spitted in a new module "mail_group". Links ===== Task-2510267 See odoo/odoo/pull/71599 See odoo/enterprise/pull/19296 See odoo/upgrade/pull/2600
69 lines
3.8 KiB
XML
69 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo noupdate="1">
|
|
|
|
<!-- RULES -->
|
|
<record id="mail_channel_rule" model="ir.rule">
|
|
<field name="name">Mail.channel: access only public and joined groups</field>
|
|
<field name="model_id" ref="model_mail_channel"/>
|
|
<field name="groups" eval="[Command.link(ref('base.group_user')), Command.link(ref('base.group_portal')), Command.link(ref('base.group_public'))]"/>
|
|
<field name="domain_force">['|', '|',
|
|
('public', '=', 'public'),
|
|
'&', ('public', '=', 'private'), ('channel_partner_ids', 'in', [user.partner_id.id]),
|
|
'&', ('public', '=', 'groups'), ('group_public_id', 'in', [g.id for g in user.groups_id])]</field>
|
|
<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'),
|
|
'&', ('channel_id.public', '=', 'private'), ('channel_id.channel_partner_ids', 'in', [user.partner_id.id]),
|
|
'&', ('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"/>
|
|
<field name="groups" eval="[Command.link(ref('base.group_user')), Command.link(ref('base.group_portal'))]"/>
|
|
<field name="domain_force">[('res_partner_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
<field name="perm_read" eval="False"/>
|
|
</record>
|
|
|
|
<record id="mail_message_subtype_rule_public" model="ir.rule">
|
|
<field name="name">mail.message.subtype: portal/public: read public subtypes</field>
|
|
<field name="model_id" ref="model_mail_message_subtype"/>
|
|
<field name="domain_force">[('internal', '=', False)]</field>
|
|
<field name="groups" eval="[Command.link(ref('base.group_portal')), Command.link(ref('base.group_public'))]"/>
|
|
</record>
|
|
|
|
<record id="mail_activity_rule_user" model="ir.rule">
|
|
<field name="name">mail.activity: user: write/unlink only (created or assigned)</field>
|
|
<field name="model_id" ref="model_mail_activity"/>
|
|
<field name="domain_force">['|', ('user_id', '=', user.id), ('create_uid', '=', user.id)]</field>
|
|
<field name="groups" eval="[Command.link(ref('base.group_user'))]"/>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_read" eval="False"/>
|
|
<field name="perm_write" eval="True"/>
|
|
<field name="perm_unlink" eval="True"/>
|
|
</record>
|
|
|
|
<record id="mail_compose_message_rule" model="ir.rule">
|
|
<field name="name">Mail Compose Message Rule</field>
|
|
<field name="model_id" ref="model_mail_compose_message"/>
|
|
<field name="domain_force">[('create_uid', '=', user.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_read" eval="True"/>
|
|
<field name="perm_write" eval="True"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
|
|
</odoo>
|