Files
odoo_source/addons/mail/views/mail_message_views.xml
T
Mathieu Duckaerts-Antoine 299ebb2cdf [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.
2018-06-06 16:01:33 +02:00

180 lines
8.6 KiB
XML

<?xml version="1.0"?>
<odoo>
<data>
<!-- mail.message tree: short view !-->
<record model="ir.ui.view" id="view_message_tree">
<field name="name">mail.message.tree</field>
<field name="model">mail.message</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<tree string="Messages">
<field name="date"/>
<field name="subject"/>
<field name="author_id"/>
<field name="model"/>
<field name="res_id"/>
</tree>
</field>
</record>
<!-- mail.message form: short view !-->
<record model="ir.ui.view" id="view_message_form">
<field name="name">mail.message.form</field>
<field name="model">mail.message</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<form string="Message">
<sheet>
<group>
<group>
<field name="subject"/>
<field name="date"/>
<field name="email_from"/>
<field name="author_id"/>
<field name="record_name"/>
<field name="moderator_id"/>
</group>
<group>
<field name="parent_id"/>
<field name="model"/>
<field name="res_id"/>
<field name="message_type"/>
<field name="subtype_id"/>
<field name="moderation_status"/>
</group>
</group>
<notebook>
<page string="Body">
<field name="body" options="{'style-inline': true}"/>
</page>
<page string="Gateway">
<group>
<group>
<field name="reply_to"/>
<field name="no_auto_thread"/>
</group>
<group>
<field name="message_id"/>
<field name="mail_server_id"/>
</group>
</group>
</page>
<page string="Recipients">
<group>
<group>
<field name="partner_ids" widget="many2many_tags"/>
<field name="channel_ids" widget="many2many_tags"/>
</group>
<group>
<field name="needaction_partner_ids" widget="many2many_tags"/>
<field name="starred_partner_ids" widget="many2many_tags"/>
</group>
</group>
<group>
<field name="notification_ids">
<tree>
<field name="res_partner_id"/>
<field name="is_read"/>
<field name="is_email"/>
<field name="email_status"/>
</tree>
</field>
</group>
</page>
<page string="Tracking">
<field name="tracking_value_ids"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- mail.message search: wall view !-->
<record model="ir.ui.view" id="view_message_search">
<field name="name">mail.message.search</field>
<field name="model">mail.message</field>
<field name="priority">25</field>
<field name="arch" type="xml">
<search string="Messages Search">
<field name="body" string="Content" filter_domain="['|', ('subject', 'ilike', self), ('body', 'ilike', self)]" />
<field name="subject"/>
<field name="message_type"/>
<field name="author_id"/>
<field name="partner_ids"/>
<field name="model"/>
<field name="res_id"/>
<field name="parent_id"/>
<filter string="Has Mentions"
name="filter_has_mentions"
domain="[('partner_ids.user_ids', 'in', [uid])]"/>
<separator/>
<filter string="Need Action"
name="message_needaction" help="Unread messages"
domain="[('needaction', '=', True)]"/>
<separator/>
<filter string="Has attachments"
name="attachments"
domain="[('attachment_ids', '!=', False)]"/>
</search>
</field>
</record>
<record id="action_view_mail_message" model="ir.actions.act_window">
<field name="name">Messages</field>
<field name="res_model">mail.message</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_message_search"/>
</record>
<!-- Add menu entry in Settings/Email -->
<menuitem name="Messages" id="menu_mail_message" parent="base.menu_email" action="action_view_mail_message"/>
<record model="ir.ui.view" id="view_document_file_kanban">
<field name="name">ir.attachment kanban</field>
<field name="model">ir.attachment</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="mimetype"/>
<field name="type"/>
<field name="datas_fname"/>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="oe_kanban_vignette">
<div class="oe_attachment">
<div class="oe_name">
<field name="name"/>
</div>
<div t-if="record.type.raw_value == 'binary'">
<a t-attf-href="/web/content/#{record.id.raw_value}?download=1">
<t t-set="webimage" t-value="new RegExp('image.*(gif|jpeg|jpg|png)').test(record.mimetype.value)"/>
<div t-if="!webimage" class="o_image" t-att-data-mimetype="record.mimetype.value"/>
<div t-if="webimage" class="o_attachment_image">
<img t-attf-src="/web/image/#{record.id.raw_value}?download=1"/>
</div>
</a>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="base.action_attachment" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Attach a new document
</p>
</field>
</record>
</data>
</odoo>