RATIONALE
Channel model is a mail.thread enabled model behaving strangely with followers,
notifications and discuss. Its code should however be simplified to be more
self contained and avoid unwanted side effects on other models.
PURPOSE
Remove channel ability to follow records as it mainly adds noise without a lot
of added value. Simplify channel notification flow by using directly members
and not a delegation through a channel self-following trick. Remove followers
being channels and posting with added listeners being channels.
SPECIFICATIONS
In this commit we force messages to belong to a single document using
``model`` / ``res_id`` pair. It is not possible anymore to link a message
to channels using ``channel_ids``. A message belongs to a document and
is displayed in that document's chatter.
This change implies modifying a lot of domains, notably in chatter. Indeed
discuss for channels does not use ``('channel_ids', 'in', [3])`` domains.
They now use ``('model', '=', 'mail.channel'), ('res_id', 'in', [3])`` like
other documents fetching their messages.
This commit also removes ``channel_message_ids`` field on ``mail.channel``
model. As channels are now considered as standard documents they will use
``message_ids`` field like all other documents. Linking a channel on a message
is possible only as a link in message from now on. It is not possible to push
it into a channel anymore (no more listener channels, no more channel link).
Finally a global cleaning also linked to all previous commits is done.
LINKS
Task ID-2070632 (main task)
Task ID-2419762 (followup task)
COM PR odoo/odoo#62859
ENT PR odoo/enterprise#15172
UPG PR odoo/upgrade#2005
33 lines
1.5 KiB
XML
33 lines
1.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
|
|
<record model="mail.channel" id="channel_all_employees">
|
|
<field name="name">general</field>
|
|
<field name="description">General announcements for all employees.</field>
|
|
</record>
|
|
|
|
<!-- notify all employees of module installation -->
|
|
<record model="mail.message" id="module_install_notification">
|
|
<field name="model">mail.channel</field>
|
|
<field name="res_id" ref="mail.channel_all_employees"/>
|
|
<field name="message_type">email</field>
|
|
<field name="subtype_id" ref="mail.mt_comment"/>
|
|
<field name="subject">Welcome to Odoo!</field>
|
|
<field name="body"><![CDATA[<p>Welcome to the #general channel.</p>
|
|
<p>This channel is accessible to all users to <b>easily share company information</b>.</p>]]></field>
|
|
</record>
|
|
|
|
<record model="mail.channel.partner" id="channel_partner_general_channel_for_admin">
|
|
<field name="partner_id" ref="base.partner_admin"/>
|
|
<field name="channel_id" ref="mail.channel_all_employees"/>
|
|
<field name="fetched_message_id" ref="mail.module_install_notification"/>
|
|
<field name="seen_message_id" ref="mail.module_install_notification"/>
|
|
</record>
|
|
|
|
<record model="mail.channel" id="mail.channel_all_employees">
|
|
<field name="group_ids" eval="[Command.link(ref('base.group_user'))]"/>
|
|
</record>
|
|
</data>
|
|
</odoo>
|