Purpose of this commit is to allow moderation on incoming messages in discussion channels. On some channels on which moderation is required messages should be in a pending moderation stage. Moderators can accept or refuse messages as well as always allow or ban messages coming from a given set of emails. Channels now have an option to be moderated. Moderators can be added on channels. They have access to a specific UI in Discuss to see and take action on messages waiting for moderation. Concerning mail.thread message that are pending moderation are not notified. It means nobody receives a notification about them. Moderation process calls the notification once the message is validated. Various features included in this commit : * a model is added to store the decision about emails, allow or ban; * access rights are updated so that only moderators can modify moderation fields on message; * specific bus notifications are send to moderated people as well as to moderators on incoming emails as well as when a decision is taken; * options are added on channels to send explanations to moderated emails; * options are added on channels to write and send guidelines explaining why and how moderation is performed; * a reminder is send daily to moderators with remaining messages to moderate; * discuss UI is adapted and a new channel is added below Inbox and Starred giving access to moderation tools; * chanenl UI is adapted allowing to moderate directly inside channels; This commit is linked to task ID 29521. Closes #21921.
61 lines
3.1 KiB
XML
61 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data 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="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="mail_followers_read_write_own" model="ir.rule">
|
|
<field name="name">mail.followers: write its own entries</field>
|
|
<field name="model_id" ref="model_mail_followers"/>
|
|
<field name="groups" eval="[(4, ref('base.group_user')), (4, ref('base.group_portal'))]"/>
|
|
<field name="domain_force">[('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="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="[(4, ref('base.group_user')), (4, 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="[(4, ref('base.group_portal')), (4, ref('base.group_public'))]"/>
|
|
</record>
|
|
|
|
<record id="mail_activity_rule_user" model="ir.rule">
|
|
<field name="name">mail.activity: user: own only</field>
|
|
<field name="model_id" ref="model_mail_activity"/>
|
|
<field name="domain_force">[('user_id', '=', user.id)]</field>
|
|
<field name="groups" eval="[(4, 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_moderation_rule_user" model="ir.rule">
|
|
<field name="name">White/Black List: moderators: moderated channels only</field>
|
|
<field name="model_id" ref="model_mail_moderation"/>
|
|
<field name="domain_force">[('channel_id.moderator_ids', 'in', user.id)]</field>
|
|
</record>
|
|
</data>
|
|
</odoo>
|