Commit Graph
3147 Commits
Author SHA1 Message Date
Thanh Dodeur 0051fda788 [FIX] mail: prevent blocking datachannel access if one is unavailable
Before this commit, if one RTCDataChannel was not available, signaling
using the RTDDataChannels was faulty.

This commit fixes this issue by skipping unavailable dataChannels.

closes odoo/odoo#76102

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-07 18:08:20 +00:00
Julien Giannone 63ff23c218 [IMP] mail, web: add message reactions with emojis
task-2361194

closes odoo/odoo#75630

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-07 18:08:11 +00:00
Bruno Boi 164cb86d2d [FIX] web,mail: various dropdown design fixes
apply new control panel styling from sri
remove o_dropdown_menu_right (looks unused)
remove o_dropdown_inline (this is a regression for small screens, apparently we would like to have this possibility on smaller screens. This does not break mobile usage but Mobile styling is still a bit weird though)
fix systray activitymenu in mobile (issue was introduced with 29731b40)
fix subdropdown flickering (before this commit, parent dropdown was in absolute positioning, making the position hook generate flicker, now it it fixed from the beginning)

Part-of: odoo/odoo#73311
2021-09-07 10:04:39 +00:00
Thanh Dodeur 53c6ceb909 [FIX] mail: prevents video access traceback after ending a call
Before this commit, it was assumed that the call was still active when
the video permission was granted, this assumption was false and this
commit fixes this issue.

closes odoo/odoo#75999

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-06 15:47:14 +00:00
Louis Wicket (wil) 401fc7efe9 [IMP] discuss: add 'Start a meeting' feature
- Add a new stand-alone page "WelcomeView"
    - Redirect people who join using an invitation link to the WelcomeView
    - Add microphone/camera preview
    - Allow guests to choose a name from the WelcomeView
- Add "Start a meeting" button to the discuss sidebar
    - Create a new channel on click on the "Start a meeting" button
    - Display ChannelInvitationForm on click on the "Start a meeting"
button
    - Add a new field to `mail.channel` in order to define the display
mode to use for videos (e.g full screen) when joining a meeting

Task 2494829

closes odoo/odoo#75899

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-06 08:21:38 +00:00
Thanh Dodeur ac99b09cdc [IMP] mail*: add audio and video conference with webRTC
*test_discuss_full,test_lint

This commit adds the audio and video conference feature to mail channels
and integrate it with the groupDM/guest features.

Adds new mp3 and ogg files (from task-2554674) for sound effects.

- Adds three new tables:
    * `mail.channel.rtc.session` to manage the peerToPeer interactions
      during rtc calls.
    * `mail.ice.server` to provide ICE servers necessary to establish
      peerToPeer connections with webRtc.
    * `res.users.settings.volumes` to hold the partner-to-partner volume
      settings, each partner can create one new setting per other
      partner to configure the volume coming from those partners during
      calls.

- changes res.config.settings:
    * Adds new fields for the Twilio credentials to use their STUN/TURN
      service.

- changes res.user.settings:
    * Adds 4 fields for the push to talk and voice activation.

- changes mail.channel:
    * Adds a new field `rtc_session_ids` that represents the active
      participants in a rtc call on that channel.

- changes mail.channel.partner:
    * Adds a new field `rtc_inviting_session_id` that represents the
      rtcSession of the user that is inviting that channelPartner to a
      call.

task-2366708

closes odoo/odoo#66611

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-04 06:23:56 +00:00
Samuel Degueldre 776d1ee08b [IMP] mail: allow user to delete their messages
This commit allows users to "delete" their messages in discuss, as well
as their notes on other records. Admins can delete anyone discuss
messages or notes. Tracking messages such as a change in stage or other
cannot be deleted.

This "delete" is a "soft-delete" in that it only empties the message's
content, so that it is no longer displayed in the UI, but remains in the
database so that people who got notified by email can still reply to the
message, among other things.

task-2365646

closes odoo/odoo#74857

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-03 02:03:25 +00:00
Louis Wicket (wil) 80d74e7ee0 [IMP] mail, web, *: add support for guest users
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
    snailmail, survey, test_discuss_full, test_mail, web_editor, website,
    website_livechat

 - Create new model `mail.guest` for guests.
 - Rewrite some RPCs to target routes rather than model methods so that
   guests are able to use them.
 - Patch JS and python models to support guests.
 - Create a stand-alone page and boot the channel in it.

task-2494829

closes odoo/odoo#75496

Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-02 00:43:34 +00:00
Lucas Perais (lpe) 33476a4888 [FIX] web, mail: remove unnecessary console.log
Following commit 118ddcace0.
a few console.log escaped the attention of the reviewer.

This commit removes them.

closes odoo/odoo#75832

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-09-01 11:05:50 +00:00
Qiuyu (QHO) d62f29f824 [FIX] mail: group chat item should not have ThreadIcon
Small fix in discuss_sidebar_category_item. An item with type "group" should not have a ThreadIcon.

closes odoo/odoo#75731

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-30 10:59:19 +00:00
Francois (fge) 118ddcace0 [IMP] web, mail: field widgets' smart action in command palette
This commit adds the smarts actions:
- Assign to... (many2one_avatar and many2many_avatar)
- Assign/unassign to me  (many2one_avatar and many2many_avatar)
- Set priority... (priority)
- Set kanban state... (state_selection)

These smarts actions are commands with hotkeys accessible from
the form views containing the widget to which they are linked.

closes odoo/odoo#75312

Task-id: 2588238
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-30 08:37:01 +00:00
Qiuyu (QHO) e8922db3da [IMP] mail: add default avatar for channels
- Channels
    * "hash tag" avatar with different backgroud colors
    * only private channels have lock thread icon
- DM groups
    * "users" avatar with different background colors
    * no thread icon

task-2584994

closes odoo/odoo#75653

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-27 20:53:44 +00:00
Julien Giannone 845bb6cc93 [IMP] mail: add group chat feature
task-2360934

closes odoo/odoo#75633

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-26 17:25:06 +00:00
Sébastien Theys c685fc18c1 [IMP] mail: prevent "already in update cycle" loop after crash
task-2620828

closes odoo/odoo#75661

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-26 16:25:19 +00:00
Sébastien Theys f71484fdae [IMP] mail: remove thread rename from discuss sidebar
task-2628751

closes odoo/odoo#75659

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-26 16:25:15 +00:00
Sébastien Theys 9cc08d57e5 [FIX] mail: resolve issue with discuss app not considered opened
`isOpen` is only written during mounted but it might happen that the discuss
record is not yet created when the component is mounted.

task-2632702

closes odoo/odoo#75655

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-08-26 16:25:06 +00:00
Odoo's Mergebot 6c4910aac7 [MERGE] {sale_}project,{hr,sale}_timesheet,mail: add Project Sharing feature
Purpose:
=======

This commit adds the project sharing feature. This feature consists to
share the backend views about project.task to portal users.

About the access rights:
- The project manager can share a project with project sharing feature.
  To do this, he need to give access to portal users that we want their access in project sharing views.
  He can choose between 2 differents accesses:
    1. **Readonly**: The use has access to the classic portal views (on which he can post messages, and have a readonly access rights to the related fields)
    2. **Edit**: the portal with this access right will can edit some fields of `project.task` model.

The difference between the classic backend views and the project sharing
views is in the project sharing views, we list the fields that the user
can read/write, so the portal users can see only the fields in
our list.
Moreover, the actions and the contextual menu (actions dropdown) are not
available in the project sharing views and the stat buttons are visible
but the click on these buttons are disabled.

Implementation details:
======================

- add `allow_project_sharing` option in project form view.
- create the webclient and routes.
- create own qweb bundle.
- add project sharing views.
- use the session to define the action and active_id
- create public fields for project sharing: in this step, we lists all field
names of the `project.task` model that we want to display for the
portal user. Two lists are created, one for only readable field names
and the other one for the writable field names.
Moreover, two properties are defined in the `project.task` model to use the
both lists.
- use `access_token` and check model in project sharing route: in this
step we check if the model is `project.project` and the `access_token`
is the one set in the project since we have the id of the project in the
params url.
- protect ORM methods: to avoid the portal user has accessed to too much
fields that he can, we have to check if all asked fields are in
the readable fields, if all fields are available for these users than we do the
method, otherwise we raise an `AccessError` exception.
- allow only `GET` method to enter project_sharing routes: the
`/my/project/<int:project_id>/project_sharing` route must only be
called with a `GET` method because this route is only used to have the template
to render the project sharing webclient.
- redirect the link in one of the sharing wizards to project sharing views if the portal user has an access
to the shared project and if the shared project has the Project Sharing feature enabled.
- only load `project.task` views for project sharing.
- remove longpolling in the project sharing.
- disable click on avatar to open the chat with the user or open the hr.employee form because these features are not authorize in the project sharing.
- remove the contextual action menu in the project sharing views
- add the chatter in the `project.task` form for the portal user with at least 'comment' access.
  This user could send message and see the public message like portal chatter.
- replace the basic portal views when the portal user selects project in `/my/projects` by the project sharing views if the `allow_project_sharing` is enabled for this project and if the portal user can access to the project sharing views of this project.

Why did we implement this feature in this way ?
====================================

We thought to create a `project.task.portal` model. This model had contained all fields that the portal user can read and edit (`readonly=True` if the portal user can just read the field).
We had 2 possibilities for this solution:

1. link this model with `project.task` either with inherits attribute in `project.task` or by creating a many2one field in the project.task.
    The problem with this solution is with `inherits`, we just copy all fields in `project.task` and not method, so we need to duplicate methods used in both models. Moreover, with `inherits` possbility, we have to create all records even if the Project Sharing feature is not used. If we took the other possibility (that is, create the Many2one field in `project.task` model) asks to create records when the `allow_project_sharing=True` in a project and also unlink/archive records when the Project Sharing feature is disabled in a project. The process is harder each time, the user enables/disables the feature. That's why we didn't do this solution.
2. the new model contains a sql view and we use the related field to create/edit tasks in project sharing views.
    We don't do this solution because it was a big change and increase the complexity. Moreover, if the sql view gives all tasks of shared projects, we could have a security issue because the portal user could have access to the tasks of shared project in which he didn't have any access.

Another solution that we thought before doing this feature was to create the kanban view in portal. We didn't do that because:
1. the render of this view will not be the same than the one in `/web`,
2. we didn't want to duplicate the kanban view,
3. we need to allow the portal to create/edit task.

task-2379518

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#73341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-26 18:24:47 +02:00
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
Xavier BOL (xbo) 0e1961b1dd [IMP] project,mail: disable click on avatar
Before this commit, there is no options to disable the click on the
avatar to open the chat in `Many2OneAvatarUser` widget.

This commit adds an option called `no_open_chat` set by default to false
and this option allow to disable the click when it is true. This option
is useful for the project sharing views.

task-2379518

closes #73341
2021-08-26 14:59:33 +02: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 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 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