Commit Graph
685 Commits
Author SHA1 Message Date
Alexandre Kühn b5ce1e39d7 [IMP] mail: Improve Emoji Picker (step 2)
Improvements:

- Much more emojis in the emoji picker (more than 1800 emojis, up from 81)
- Fuzzy search bar to find emoji in the emoji picker

Known limitations:

- Emoji visual is based on browser/OS, so some emojis may not be visible on some devices

Task-2957928

closes odoo/odoo#99343

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-07 02:17:47 +02:00
tsm-odoo 0f9b11a025 [REM] mail: remove obsolete wait until event parameter
The `waitUntilEvent` start helper parameter has become obsolete. Indeed,
events are systematically awaited by the `openDiscuss`/`openView`
helpers. This commit removes this parameter.

closes odoo/odoo#99577

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 15:22:59 +02:00
Zelong Lin d57c64f95b [IMP] mail, *: remove 'public' field in channel
*: im_livechat, website_livechat

Access right should be based on channel type and membership instead.
Chat always private, group always private, channel private should
disapear and be a group instead (migration needed), and other channel
always public (but they can still be further restricted with
the "allowed groups" feature)

task-2632861

closes odoo/odoo#90415

Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 10:57:59 +02:00
tsm-odoo 591baa9003 [FIX] mail: fix indeterministic chat window manager test
Before this PR, some mail tests relying on DOM elements being present
but that are added after the messaging initialization could fail
unpredictability. This commit fixes this issue by waiting the next
render following the initialization of messaging.

closes odoo/odoo#99461

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 16:54:12 +02:00
Louis Wicket (wil) ff49527fb5 [IMP] mail, *: convert ThreadPreview to use Channel instead of Thread
* = im_livechat, rating, test_mail_full

Part of task-2948676.

closes odoo/odoo#99342

Related: odoo/enterprise#30921
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-05 16:53:52 +02:00
Louis Wicket (wil) 9beb2b13d3 [MOV] mail, *: rename ThreadPreviewView files to ChannelPreviewView
Part of task-2948676.
* = im_livechat, rating, test_mail_full

Part-of: odoo/odoo#99342
2022-09-05 16:53:52 +02:00
Didier (did) 7ceb079455 [IMP] mail: implement link preview with OpenGraph Protocol
OpenGraph Protocol https://ogp.me/ allow us to get some data from the link that
are shared in message.

task-2365881

closes odoo/odoo#82641

Related: odoo/enterprise#30867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 14:49:30 +02:00
Sébastien Theys 545d23888b [IMP] mail, im_livechat, *: add typing for guest and clean code
* = bus, hr_holidays, test_discuss_full

- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly

task-2664853

closes odoo/odoo#98923

Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 20:21:58 +02:00
Sébastien Theys aad27c38ea [FIX] mail: fix model manager isDebug
Mix of proxy and non-proxy was causing issue in set of records.

closes odoo/odoo#99388

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 15:33:36 +02:00
Didier (did) 5c861656b6 [IMP] mail: rename MessageListViewMessageViewItem in MessageListViewItem
part of task-2918956

Part-of: odoo/odoo#98262
2022-08-30 23:40:24 +02:00
Louis Wicket (wil) 6a6e737f61 [IMP] mail, *: move channel concerns in Thread from Thread to Channel
This commit is the continuation of task-2948676 which consists of
lightening the Thread model by moving the channel-specific behaviours to
the Channel model.

The changes revolve around the DiscussSidebarCategoryItem model. The
goal is to use channel instead of thread as identifying field for
DiscussSidebarCategoryItem, and to move channel-specific fields involved
in the computes of this model from Thread to Channel.

Changes in this commit include:
+ move `avatarCacheKey` from Thread to Channel
+ move `correspondent`
+ move `correspondentOfDmChat`
+ move `custom_channel_name`
+ move `localMessageUnreadCounter`
+ move `serverMessageUnreadCounter`
+ introduce `Channel/displayName`
+ use channel instead of thread as identifying field for
DiscussSidebarCategoryItem

Part of task-2948676.

closes odoo/odoo#98149

Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 20:22:14 +02:00
tsm-odoo 5b5052a774 [IMP] mail: remove follower subtype local id in tests
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the message
id is more than enough and available. This PR replaces follower subtype
local id data attribute by its subtype id.

task-2959366

closes odoo/odoo#98776

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-25 04:20:48 +02:00
Thanh Dodeur 3723b222b3 [IMP] mail: Call settings menu as right sidebar
This commit changes layout of call settings menu.

Before this commit, it was available in call action list
while in a call, as a dialog, in More > Settings.

With this commit, it's now available as an button in
thread topbar and chat window header, next to member
list button (`fa-cog`). It can be accessed even while
not in a call.

Task-2929713

closes odoo/odoo#96954

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-25 01:53:50 +02:00
tsm-odoo e91c0728fc [IMP] mail: remove message local id in tests
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the message
id is more than enough and available. This PR replaces message local id
data attribute by message id.

task-2959366

closes odoo/odoo#98728

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-24 19:53:54 +02:00
Brieuc-brd 30f520a494 [IMP] mail: Message, remove note style
Prior to this commit, the note had its own style. This created too much
confusion with the other message types.

This commit removes the note style to improve the readability in the
chatter.

closes odoo/odoo#98043

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-24 02:04:58 +02:00
Louis Wicket (wil) a8c73f285f [IMP] mail, rating: turn computes and relateds readonly by default
Automatically add readonly on computed and related fields. This commit
required to rewrite some preexisting fields to make them readonly.
Task-2955927.

closes odoo/odoo#98541

Related: odoo/enterprise#30625
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:22 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
Louis Wicket (wil) af7dd7d79d [FIX] mail: get_mention_suggestions returns correct channel data
ac08da0a834631b2a7c39c40b1f36f01a85e8617 moved channel_type from Thread
to Channel, but data returned by get_mention_suggestions have not been
updated accordingly. This commit adapts it.

Follow-up of task-2948676.

closes odoo/odoo#98677

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 15:05:56 +02:00
tsm-odoo c218c09119 [IMP] mail, im_livechat: remove thread local id usage from tests
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the thread
model/id are more than enough and available. This PR replaces thread
local id data attribute by thread model/id.

task-2959366

closes odoo/odoo#98588

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 15:05:36 +02:00
Zelong Lin 02fc44ab55 [IMP] mail: compact message action list
Introduce messag_action and message_action_view

task-2869932

closes odoo/odoo#97738

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-22 19:12:39 +02:00
Sébastien Theys 34d775e873 [IMP] mail, *: remove explicit usage of insert-and-replace
* = calendar, im_livechat, rating, snailmail, test_discuss_full, test_mail,
    website_livechat

Distinction between "replace" and "insert-and-replace" can be guessed based on
the type of the provided data.

task-2957295

closes odoo/odoo#98404

Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-19 11:53:05 +02:00
Zelong Lin 7be59d6603 [IMP] mail: add group_public_id into mock setup
task-2957108

closes odoo/odoo#98378

Related: odoo/enterprise#30582
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-18 21:09:12 +02:00
Sébastien Theys 5b21f8b346 [IMP] mail: split localId and record indexing
Part of task-2741982

closes odoo/odoo#97026

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-18 21:08:56 +02:00
Louis Wicket (wil) 5d43fad9e6 [IMP] mail, *: auto add implicit attributes of identifying fields
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.

Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

closes odoo/odoo#98283

Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:53 +02:00
Rahul Prajapati 4123505efa [IMP] *: have replace as default command on update
* im_livechat, mail, snailmail, website_livechat

PURPOSE:

A `replace` command should be default while updating a field.

SPECIFICATION:

- If no command is passed while updating a field, add a `replace` command as
default.
- Remove all the existing occurrences of `replace` command.

Task-2851488

closes odoo/odoo#95885

Related: odoo/enterprise#30494
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:11 +02:00
Sébastien Theys 60c87dd426 [IMP] mail, *: introduce identifyingMode and remove identifyingFields
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

This simplifies definition and overrides and opens up new identification
opportunities.

Part of task-2741982

closes odoo/odoo#98166

Related: odoo/enterprise#30470
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-08-17 11:21:40 +02:00
tsm-odoo 9d86827840 [IMP] bus, *: only use one mock server during tests
*: mail, web.

The pyEnv used during tests is based on the mock server to provide
server like api. This issue is that when creating multiple environments
during tests, a new mock server is created each time. This is not realistic
since in a real world scenario, multiple tabs would share a single server.
In order to make pyEnv work with multiple tabs tests (e.g. multiple env tests),
let's create a single mock server shared between js environment during a test.

task-2053917

Part-of: odoo/odoo#97975
2022-08-12 23:37:38 +02:00
Didier (did) a682b0349c [IMP] mail: disable chatter when the user has no write access
Before this PR a user that could not post on the chatter could still try. This
PR disable the chatter topbar menu if the user doesn't have the write access.

task-2693304

closes odoo/odoo#88531

Related: odoo/enterprise#30054
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-12 23:37:10 +02:00
Louis Wicket (wil) 090c558452 [IMP] mail, *: introduce Mailbox model for mail.box threads
This commit will simplify the code of Thread by properly splitting all
behaviors exclusive to mail.box threads.

* = test_mail_full

closes odoo/odoo#97996

Related: odoo/enterprise#30402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-12 17:06:08 +02:00
tsm-odoo 1766c6997a [FIX] bus, mail: fix model definitions setup moved in wrong module
The model_definition_setup has been moved in [1] but adds some models
to be fetched that are not related to the bus module. This would lead
to error in single module builds.

closes odoo/odoo#97937

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-11 17:57:02 +02:00
Louis Wicket (wil) 52e6e0ce54 [IMP] mail, *: move channel_type field from Thread to Channel
As the name suggests, `channel_type` only makes sense for Channel.
This commit moves `channel_type` from Thread to Channel.

* = im_livechat, test_discuss_full

Part of task-2948676.

closes odoo/odoo#97779

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-11 17:56:51 +02:00
tsm-odoo 75007b578e [MOV] bus, *: move startServer test helper to the bus module
*: calendar, hr, hr_holidays, im_livechat, note, rating, snailmail,
test_mail, test_mail_full, website_livechat, website_slides.

Part-of: odoo/odoo#97771
2022-08-10 14:43:41 +02:00
Lucas Perais 1814888a7f [FIX] mail: text emojis field should remove its dropdown on destroy
Have a field with widget text_emojis.
Click Edit on the form view.
Click Save.

Before this commit, the button that opens the dropdown was still present in the dom in readonly mode.

After this commit, it is correctly removed.

closes odoo/odoo#97704

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-09 09:00:10 +02:00
tsm-odoo d952fbcb96 [IMP] bus: move sendNotification to mail module
The BusService class only adds the possibilty to send notifications.
This is only used in the mail module. Let's remove this unnecessary
override and move this functionnality into mail models.

closes odoo/odoo#97685

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-09 06:28:00 +02:00
Didier (did) 633f58f8a4 [IMP] mail: im_status for guests
task-2883466

closes odoo/odoo#97076

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-08 21:02:21 +02:00
tsm-odoo d998c54feb [FIX] mail, bus: fix mock sendone/many crash during tests
The mock of sendone/many was relying on the bus_service. Since owl.Component.env
is changing during tests setup, the bus_service was not always defined. In order
to make this more reliable, the longpolling/poll route is now mocked, returning a
promise that can be resolved by the sendone/many methods.

closes odoo/odoo#97298

Related: odoo/enterprise#30059
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-05 16:35:45 +02:00
tsm-odoo de498ee63a [FIX] mail: fix remove attachment from composer test
This PR fixes the 3922 runbot issue.

closes odoo/odoo#96972

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-03 04:31:46 +02:00
Louis Wicket (wil) fc2118f5c3 [IMP] mail: remove Record/create
The way the code has evolved, `create` is now no more than an
unnecessary indirection for `insert`.

This PR removes `create` and replaces its uses with `insert` directly.

closes odoo/odoo#97058

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-01 10:55:44 +02:00
tsm-odoo c68c0f3400 [IMP] mail, *: remove create component methods in tests
*: sms, snailmail, hr_holidays.

task-2871066

closes odoo/odoo#97093

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-29 18:34:19 +02:00
Brieuc-brd f169280275 [IMP] mail: increase the ChatWindow size
Following the redesign of ChatWindow, this commit increases its size.

task-2823627

Part-of: odoo/odoo#92872
2022-07-29 15:53:05 +02:00
tsm-odoo 8a04a0297a [IMP] mail, im_livechat: remove createComposerComponent
task-2871066

closes odoo/odoo#96886

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 13:21:22 +02:00
tsm-odoo 4b1b981a93 [IMP] mail: remove create composer suggestion view
task-2871066

closes odoo/odoo#96899

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 05:04:48 +02:00
Sébastien Theys 13245211a1 [IMP] mail: move mark_all_as_read into message_fetch
This removes an extra request, targets fetched messages more reliably and
simplifies the code.

task-2847909

closes odoo/odoo#96840

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-28 03:51:33 +02:00
tsm-odoo 901a43f532 [IMP] bus, *: improve multi tab service
*: calendar, im_livechat, survey.

Following @ged-odoo review, the multi tab service has been improved:
    - multi_tab_service.js has been moved to the correct location.
    - _callLocalStorage method has been removed and replaced by
      getItemFromLocalStorage/setItemToLocalStorage.
    - underscore.js calls have been removed.
    - multi_tab_service is now using function closure style  instead of class.
    - multi_tab service is now using its own bus instance.
    - service name is now in snake case as per convention.
    - tests have been added.
    - multi tab service now handles setting/removing/getting values
      shared between  all the tabs.

closes odoo/odoo#96386

Enterprise: https://github.com/odoo/enterprise/pull/29694
Related: odoo/enterprise#29694
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 03:34:51 +02:00
Sébastien Theys b401ba6e2d [IMP] mail, *: remove legacy code from activity systray
* = calendar, crm, im_livechat, mass_mailing_sms, note, test_discuss_full,
    test_mail

task-2920645

closes odoo/odoo#96114

Related: odoo/enterprise#29794
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 02:18:15 +02:00
Sébastien Theys 28200c5ad5 [IMP] mail, web: adapt chatter container in new form
task-2871070

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
+2 bc0a0cead6 [IMP] web,*: enable owl list & form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

Part-of: odoo/odoo#78221
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:45 +02:00
tsm-odoo fdce32d186 [IMP] mail: legacy activity menu to wowl registry
To prepare for the introduction of the ActivityMenuContainer Component,
let's  make the ActivityMenu widget use the systray registry.

closes odoo/odoo#96341

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-21 00:50:17 +02:00
Louis Wicket (wil) fdcaa53ca0 [IMP] mail, *: rename mail.channel.partner to mail.channel.member
* = calendar, crm_livechat, hr_holidays, im_livechat, privacy_lookup,
privacy_lookup, test_discuss_full, test_mail_full, website_livechat

closes odoo/odoo#95912

Related: odoo/upgrade#3681
Related: odoo/enterprise#29433
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-19 11:50:37 +02:00
Louis Wicket (wil) 5fe4303a0d [IMP] mail: remove deadcode
Part-of: odoo/odoo#95912
2022-07-19 11:50:36 +02:00