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
Actually, We don't want to distract the admin with an unnecessary notification
on General Channel. The main focus should be on odoobot's tour, not on the
general channel's welcome message. And it is also not a good idea to remove the
general channel as it would reduce the discoverability of the feature.
So, we are marking the first message as read for at least admin user.
therefore admin can not distract over unnecessary welcome notification and
focus more on the rest of the functionality.
Task : 2442023
closesodoo/odoo#66010
X-original-commit: 069923e53fcb93c4cf0a0715d500d23525aafbe7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when starting a new database with demo data,
the default channel `#general` had no messages initially.
The demo data defines default messages in this channel, but were
incorrectly linked to this channel, resulting in this channel
containing no messages initially.
The messages did not define `channel_ids`, so it was considered
empty. This field is essential for displaying the message in
channel, so by being omitted these messages are not properly linked
to channels.
This commit fixes the issue by correctly linked this demo messages
to this demo channel, so that `#general` now contains some messages
initially. This commit also removes unused context
`mail_notify_noemail`.
Task-Id 2186300
closesodoo/odoo#49539
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
including:
- reset scroll position to bottom when leaving channel
- allow clicking on the avatar image
- hide stars when message is of type notification
- sort channel names
- add # before channel names
- rename Whole company channel in general
- replace \n and \r in messages by <br/>
- lighten the hover color of sidebar items in the client action
- Display @ before mentions
model has been renamed to mail.channel to prepare the slack modeling.
In future commits the mail.group model will be merged with the channel
model from im_chat. The first move is to rename mail.group into
mail.channel to have a model that will unite both features.
renamed to mail.channel.
At this point no model has been renamed; only files have been moved.
n mail, mail_group files have been renamed to mail_channel. The
website_mail_group addon has been renamed to website_mail_channel.
Some internal references have been updated (templates, linked files).