Commit Graph
3244 Commits
Author SHA1 Message Date
Francois (fge) 4500a72c1c [IMP] mail: add empty message (@ and #)
closes odoo/odoo#74933

Task-id: 2622240
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-26 13:56:14 +00:00
Sébastien Theys b1f3340042 [IMP] mail, hr_holidays: add member list on channels
task-2368906

closes odoo/odoo#75605

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-26 11:34:52 +00:00
Qiuyu (QHO) 463af6f61b [IMP] mail, im_livechat: improve Discuss sidebar
The commit is to refactor the discuss sidebar

 - threads are now organized in categories based on the thread type e.g. chat, channel
 - categories can be folded or unfolded by clicking the category title
 - for active thread, even if the category is folded, it remains under the category title
 - for channel category, a new cog button is added to view all channels
 - the active indicator bar is removed. The active item now is highlighted with a different background color
 - thread avatar is used for livechat, chat and channel
 - for livechat and chat, threads are now sorted by last activity time (pin or message exchange)

closes odoo/odoo#70986

Task-id: 2440073
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-25 17:00:06 +00:00
Didier (did) 0385199a56 [IMP] mail: move chatter handlers inside the chatter model
Part of task-2579306

closes odoo/odoo#75297

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 19:27:24 +00:00
Simon Genin (ges) 8ff923fec6 [IMP] mail: Make the channel name / description editable
Before:
Only the channel name was updatable and needed refactoring.
After:
The description can be updated as well and both edition have the same
code flow.

task id 2620687

closes odoo/odoo#74962

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 18:54:36 +00:00
Francois (fge) d7dd853a82 [REM] mail: remove "Message a user" command
The "Message a user" command has been removed because a search with
the @ namespace in the command palette does the same thing.

closes odoo/odoo#75526

Task-id: 2622240
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 13:33:27 +00:00
Sébastien Theys 4ea21df30d [IMP] mail: remove usage of isMessagingInitialized and clean main.js
Part of task-2582313

closes odoo/odoo#75286

Related: odoo/enterprise#20343
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-19 13:55:28 +00:00
Sébastien Theys 41445f2ae6 [IMP] mail, hr: access messaging without env in remaining places
Part of task-2582313
2021-08-19 13:55:28 +00:00
Sébastien Theys 512740a900 [IMP] mail: access messaging without env in remaining components
Part of task-2582313
2021-08-19 13:35:00 +00:00
Sébastien Theys c6216f0832 [IMP] mail, *: access models without env in components
* = im_livechat, snailmail, website_livechat

And finally remove env.models as this was the last remaining usage.

Part of task-2582313
2021-08-19 13:35:00 +00:00
Sébastien Theys 1a98248155 [IMP] mail, *: access models without env in models
* = hr, im_livechat, website_livechat

Part of task-2582313
2021-08-19 13:34:59 +00:00
Sébastien Theys 07185d4dba [IMP] mail, *: access models without env in tests
* = hr_holidays, im_livechat, sms, snailmail, website_slides

Part of task-2582313
2021-08-19 13:34:59 +00:00
Sébastien Theys fc0c947062 [IMP] mail: remove model manager from model field
Part of task-2582313
2021-08-19 13:34:59 +00:00
Sébastien Theys bccfb6e5d0 [IMP] mail: remove modelManager and messagingCreatedPromise from env
Part of task-2582313
2021-08-19 13:34:59 +00:00
Samuel Degueldre bd2dbf1aad [REF] mail: make full use of globs in manifest
closes odoo/odoo#75117

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-18 18:57:56 +00:00
Sébastien Theys f8a7c8d31d [IMP] mail, *: access messaging without env in most components
* = snailmail

Part of task-2582313

closes odoo/odoo#75268

Related: odoo/enterprise#20333
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-18 16:29:49 +00:00
Sébastien Theys 166999e725 [IMP] mail, *: access messaging without env in models
* = hr, hr_holidays, im_livechat, sms, snailmail, website_livechat

Part of task-2582313
2021-08-18 14:56:50 +00:00
Sébastien Theys 876e7ec581 [IMP] mail, *: access messaging without env in tests
* = hr_holidays, im_livechat

Part of task-2582313
2021-08-18 14:56:50 +00:00
Didier (did) af5ed1e5f0 [IMP] mail: move activity_box handler to model
Part of task-2579306

closes odoo/odoo#75199

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-18 13:35:02 +00:00
Sébastien Theys ffd3e48e90 [IMP] mail: move boot code in service
Part of task-2582313

closes odoo/odoo#75147

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-18 12:26:41 +00:00
Sébastien Theys 5377376097 [IMP] mail: move fields from env to messaging
Part of task-2582313
2021-08-18 12:26:41 +00:00
Sébastien Theys 5d0b8cdfc9 [IMP] mail: make messaging and models available in models without env
Part of task-2582313
2021-08-18 12:20:51 +00:00
Sébastien Theys 22044ab0ad [FIX] mail: remove the obsolete home menu events
Those are no longer existing.

task-2627699

closes odoo/odoo#75235

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-18 09:35:17 +00:00
Samuel Degueldre a25064380f [IMP] mail, *: introduce messaging components registry
*: hr_holidays, im_livechat, sms, snailmail, website_slides

Most messaging related components have common needs concerning
subscribing to model changes, and not needing to be rerendered unless
their props change. Previously, most components would call the hooks
"useModels" and "useShouldUpdateBasedOnProps" individually. Messaging
components also depend on one another quite a bit, requiring a lot of
explicit imports of other components. It would also be useful to be able
to have cyclic dependencies between component (eg Message renders a
component that allows to delete the message, and the delete component
renders the message in a confirmation dialog), but that doesn't work
with explicit imports (the odoo module system doesn't support cyclic
dependencies).

This commit adds a Component decorator that:
- Registers the component in an internal registry
- Makes all components in this registry available at render time to
components that have been registered in this way
- Calls the useModels and useShouldUpdateBasedOnProps hooks during
component initialization (setup)

enterprise PR: odoo/enterprise#20304

closes odoo/odoo#74982

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-18 10:09:24 +00:00
Antoine Guenet 15820b763f [FIX] mail: ensure minimum height on textarea to keep visibility
The chatter's textarea gets resized dynamically. However no minimum
height is set so we can end up with a height of 0. This was the case
when the chatter was added to a notebook's tab, like in mass_mailing.
This sets that minimum height so it is equal to that of its parent.

Task-2545445

closes odoo#71511
2021-08-12 10:19:14 +00:00
Sébastien Theys 4cd70f164e [IMP] mail, hr, hr_holidays, *: batch mail partner format
* = test_discuss_full

Overall less queries.

Changes:

- Batch `mail_partner_format`.
- Batch `user.employee_id` compute.
- Remove query for current leave state, use fields (and prefetch) instead.
- Move current leave state in partner format instead of channel info.

Part of task-2622462

closes odoo/odoo#73174

Related: odoo/enterprise#20186
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-12 15:22:59 +00:00
Sébastien Theys 9772512e7a [IMP] mail, *: batch channels at init messaging
* = im_livechat, test_discuss_full

Less code, less queries.

Part of task-2622462
2021-08-12 15:22:37 +00:00
Sébastien Theys 96d7102ee2 [IMP] mail, *: move init messaging in models and avoid self.env.user
* = im_livechat, test_mail

The goal of moving it in models and making it independent of current user is to
be able to test it easily in future commits.

Part of task-2622462
2021-08-12 10:11:42 +00:00
Sébastien Theys 7582625ba7 [IMP] mail, *: remove magic from channel commands
* = crm_livechat, im_livechat, mail_bot, test_mail_full

Those are hard-coded methods just like any other, remove the magic call and the
need to forward them to the client at init.

Part of task-2622462
2021-08-11 18:02:37 +00:00
Hubert (huvw) 6b9592d43a [FIX] calendar, mail: Use user supplied date format in the activity overview
Ticket: 2578903

In the overview menu, the time of a calendar event was not formatted according to the user preferences. This PR fixes that.

closes odoo/odoo#75039

X-original-commit: 0f9746adab26a792fba5d9cfe8e30ea90d7c2a67
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
2021-08-12 14:21:53 +00:00
Francois (fge) 815ca6be5d [IMP] mail: Added "New Message" command/hotkey
closes odoo/odoo#74909

Task-id: 2597153
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-11 17:12:37 +00:00
Francois (fge) f6f1b1f571 [IMP] mail: access to chat window from the command palette
From this commit, it will be possible to access the chat window
of a partner/thread from the command palette.

In the palette command, if you type :
    - @ then it will display partners
    - # then it will display threads

TaskID-2593197

closes odoo/odoo#74436

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-11 08:38:10 +00:00
Mohammed Shekha 01c460f37a [IMP] mail: support many2many_avatar in kanban and list view
Purpose
The aim of the current task is to adapt the design of this new widget to the
list and kanban views.

SPECIFICATION

Kanban
when there is only one record set in the m2m field, display it like a
many2one_avatar widget when there are two or three records set in the m2m
field, display the avatars next to each other when there are more than three
records set in the m2m field, display the first two avatars, then a grey circle
with +X in it (where X is the number of records beyond the first two), when
hovering the +X avatar, open a tooltip with the list of the remaining records
the display order of the records is the same as the order in the m2m field
the avatars behave like in the other avatar widgets (i.e. darkens on hover and
clicking on it opens the chat) except the +X avatar that does not darken or has
a cursor:pointer; on hover and is not clickable

List
same specs as for the kanban view, with the difference that the widget displays
up to five records instead of three when the widget is editable display it like
the current formview version of the many2many_avatar_user widget (i.e. tags
with avatars)

task-2563591

closes odoo/odoo#72166

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-08-06 09:12:08 +00:00
Sébastien Theys 443b38088b [FIX] mail: ignore unread of unpinned channels in menu counter
Follow up of a795a2f7d8

closes odoo/odoo#74742

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-05 09:19:56 +00:00
Sébastien Theys a795a2f7d8 [IMP] mail, *: remove useStore and dependencies
* = hr_holidays, im_livechat, snailmail, website_livechat

Part of task-2338825
Makes task-2261221 and task-2431526 obsolete

closes odoo/odoo#74589

Related: odoo/enterprise#20020
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-03 16:44:40 +00:00
Mohammed Shekha 0763d3a4f4 [FIX] mail: fix active filter not working in activity view
Before this commit: When applying active filter using progressbar in activity
view, records are not displayed based on active filter, row was not getting
highlighted based on active filter also other records not getting hidden.

After this commit: When applying active filter in activity view using
progressbar, row will be highlighted and records will be sorted based on active
filter value, like if 'green' color is clicked in progressbar then records with
green color will be displayed on top also other color records will get hidden.

task-2550959

closes odoo/odoo#74405

X-original-commit: 0fbed7291d4d242d663f3b816904525dd5b65c0c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-30 06:15:15 +00:00
Sébastien Theys 810d5fd8aa [IMP] mail, im_livechat: add new UI for inviting members on channels
Opportunity is taken to clean the various follow/join/invite methods into only
one `add_members` method.

Part of task-2360169

closes odoo/odoo#74425

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-07-30 15:52:33 +00:00
Samuel Degueldre 4c7ef96974 [REF] web: refactor debug menu to use context in env instead of service
This makes the debug menu more natural to use, and makes the difference
between the "in-dialog" and "out-of-dialog" debug contexts explicit.

closes odoo/odoo#74346

Related: odoo/enterprise#19967
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-30 06:01:42 +00:00
Sébastien Theys 719689cb25 [IMP] mail: replace discuss control panel by new top bar
Part of task-2369636

closes odoo/odoo#71959

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-07-27 12:06:58 +00:00
Sébastien Theys 4f07d86026 [IMP] mail: remove search in discuss messages
It is a feature we would like to have, but it currently doesn't work well.

- Search is text based, but messages are HTML based, which means a lot of result
  make no sense because they match HTML tags, attributes, ... Inversely when
  searching for multiple words that do exist together but are separated by tags,
  it will fail to find them.
- Content of messages is actually not indexed, which means the search doesn't
  scale in big channel or with long messages. Indexing it is not trivial and has
  a huge cost in terms of storage and dependencies (trigram index for example).
- The search of the control panel is great for business documents but it does
  not fit the kind of searching UI that we would like inside discussions.

It is therefore decided to remove the feature until we are able to do it well.

Part of task-2369636
More information also on task-2359037

closes odoo/odoo#73903

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-07-23 08:21:14 +00:00
Xavier Morel e1fdc523c6 [FIX] mail: remove non-owl t-raw
The Activity widget is apparently completely unused now that owl, so remove it, and its template
2021-07-20 05:41:35 +00:00
Xavier Morel 281f9c9738 [FIX] mail: de-t-raw-ify composer template
No idea why it's using a t-raw for smileys.
2021-07-20 05:41:35 +00:00
Xavier Morel 67e7190611 [IMP] *: convert dialog title to t-out
Need to check and mark legit uses of HTML as Markup. Also fix some
title formattings which are not great (mostly around translations) and
de-escape titles which don't need to be escaped anymore.
2021-07-20 05:41:30 +00:00
Xavier Morel 0e552b96da [FIX] *: convert tip contents to t-out
Requires markup every markup-using tip content as Markup. Would be a
nice occasion to migrate everything to a markup-safe markdown I think,
especially if we could migrate the translations so we don't lose them.
2021-07-20 05:40:55 +00:00
Mathieu Duckerts-Antoine 5225b75a93 [IMP] web: search view for "Schedule activity" dialog
Before this commit, click on "Schedule activity" in the activity view
would open a dialog in which the search view is the default one on the
current activity view model.

With this commit, we make the dialog use the same search view as the
activity view.

Done to help with the task 2502339

closes odoo/odoo#73697

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-14 14:05:39 +00:00
Samuel Degueldre 08afc0af8f [REF] *: remove use of legacy notifications from tests
When writing the new webclient, the notification service was rewritten,
and all of its uses in production code were changed to use the new
services, however, some tests were still reliant on the old notification
service.

This commit removes references to the legacy notification service so
that we can be one step closer to removing it from the code base.

Part of #72675
2021-07-14 07:34:18 +00:00
Sébastien Theys 2bffa11758 [FIX] mail: properly handle undefined in js compute related
The value of the related field should be cleared:
- If the other record no longer exists.
- If the target value is undefined.

This might fix hard to understand bugs, such as task-2410314

closes odoo/odoo#73743

X-original-commit: f1ff90bf48f22a4bed299abeb8e1d415cdfab9e0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-07-14 19:46:35 +00:00
Sébastien Theys f7d8c40c5d [FIX] mail: handle js record being created and deleted in same cycle
By luck the situation never happened before, but it is legitimate to handle it.
A future commit will actually introduce the possibility of the issue happening.

closes odoo/odoo#73741

X-original-commit: 62fa7c94724b8144d21ce577aa2f04d5d837c053
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-07-14 18:50:05 +00:00
Sébastien Theys c96a30a8fb [IMP] mail: remove static mention suggestions
Returning all the users at init does not scale. Mention suggestion code is good
enough now that this is no longer necessary.

closes odoo/odoo#73689

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-07-14 10:45:44 +00:00
Sébastien Theys 6fe1173107 [IMP] mail: prevent partner name from overflowing
Some of them were completely missing (eg. author name on message, followers
menu), others were only partially done (eg. missing no wrap).

Adapt all of them to guideline with class.

closes odoo/odoo#73660

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-07-14 10:11:45 +00:00