diff options
| author | Mathieu Duckaerts-Antoine <dam@odoo.com> | 2018-05-24 15:27:28 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-06-06 16:01:33 +0200 |
| commit | 299ebb2cdf63de2e3967da0d2f3e7effd239812b (patch) | |
| tree | f2681c0fc1e283acdfd5942392db8f17ddc7801d /addons/mail/data | |
| parent | eeab18d753db21bca0636836c40df91268549390 (diff) | |
[IMP] mail: add moderation on channels
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.
Diffstat (limited to 'addons/mail/data')
| -rw-r--r-- | addons/mail/data/ir_cron_data.xml | 15 | ||||
| -rw-r--r-- | addons/mail/data/mail_data.xml | 32 |
2 files changed, 46 insertions, 1 deletions
diff --git a/addons/mail/data/ir_cron_data.xml b/addons/mail/data/ir_cron_data.xml index 8b742a7c02d..d1012c9cae6 100644 --- a/addons/mail/data/ir_cron_data.xml +++ b/addons/mail/data/ir_cron_data.xml @@ -26,5 +26,18 @@ <field eval="False" name="doall" /> <field name="priority">1000</field> </record> + + <record id="ir_cron_mail_notify_channel_moderators" model="ir.cron"> + <field name="name">Mail: Notify channel moderators</field> + <field name="model_id" ref="model_mail_message"/> + <field name="state">code</field> + <field name="code">model._notify_moderators</field> + <field name="user_id" ref="base.user_root" /> + <field name="interval_number">1</field> + <field name="interval_type">days</field> + <field name="numbercall">-1</field> + <field eval="False" name="doall" /> + <field name="priority">1000</field> + </record> </data> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml index 11f0117066f..fbbc41f5202 100644 --- a/addons/mail/data/mail_data.xml +++ b/addons/mail/data/mail_data.xml @@ -226,5 +226,37 @@ </td></tr> </table> </template> + + <!-- Channel and moderation related data --> + <template id="mail_channel_notify_moderation"> +<div> + <p>Hello <t t-esc='record.name'/></p> + <p>You have messages to moderate, please go for the proceedings.</p><br/><br/> + <div style="text-align: center;"> + <a href="/web#action=mail.mail_channel_action_client_chat&active_id=channel_moderation" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">Moderate Messages</a> + <br/><br/><br/> + </div> + <p>Thank you!</p> +</div> + </template> + + <record id="mail_template_channel_send_guidelines" model="mail.template"> + <field name="name">Partner: Send channel guidelines</field> + <field name="model_id" ref="base.model_res_partner"/> + <field name="email_from">${object.company_id.catchall or object.company_id.email|safe}</field> + <field name="partner_to">${object.id}</field> + <field name="subject">Guidelines of channel ${ctx['channel'].name}</field> + <field name="body_html" type="xml"> +<div> +<p>Hello ${object.name or ''},</p> +<p>Please find below the guidelines of the ${ctx['channel'].name} channel.</p> +<p> +${ctx['channel'].moderation_guidelines_msg} +</p> +<p></p> +</div> +</field> + <field name="user_signature" eval="False"/> + </record> </data> </odoo> |
