Commit Graph
4030 Commits
Author SHA1 Message Date
Louis Wicket (wil) 7e301e24c5 [IMP] mail: introduce Device/hasRtcSupport
Rename Rtc/isClientRtcCompatible to Device/hasRtcSupport.

closes odoo/odoo#94683

Enterprise: https://github.com/odoo/enterprise/pull/28900
Related: odoo/enterprise#28900
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-27 17:35:17 +02:00
Radhika ShyaraandPrakash Prajapati 1e2b70012a [FIX] mail: check if the user can access to the thread
Before this commit, when the user creates a private task
and assign another user to that task and then removes
himself and save the task, the current user should no
longer access to that task since the task becomes this
private task of the other user assigned on it.
So when the current user changes anything in that task,
it will have a `Access Error`.
However if the user tries to remove a follower on that
task he will also have a traceback because no thread is found.
The reason why no thread is found is because the user has
no longer access to the record and so he has no longer
access to the chatter.

This commit checks if a thread is found before continuing
the process. If no thread is found then the user has no
access to the chatter instead of throwing a traceback
because no thread is found.

task-2857229

closes odoo/odoo#94665

X-original-commit: 2c68e397b3c12657024e70016808183c89260168
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Prakash Prajapati <ppr@odoo.com>
2022-06-27 16:25:58 +02:00
Louis Wicket (wil) 15e907f54b [IMP] mail: introduce Messaging/isInQUnitTest
Add `isInQUnitTest` field to `Messaging`.
This is useful in particular to prevent audio from being played during
tests.

Part of task-2804940.

closes odoo/odoo#94632

Enterprise: https://github.com/odoo/enterprise/pull/28885
Related: odoo/enterprise#28885
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-27 16:25:40 +02:00
Sébastien Theys 9de429e747 [IMP] mail, project: move chatter container setup code in init
Setup was conditionally done in render lifecycle methods, but it could be moved
to init instead, allowing to simplify the code and remove unnecessary methods
and overrides.

Part of task-2871070

closes odoo/odoo#94307

Related: odoo/enterprise#28893
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-27 15:11:13 +02:00
Renaud Thiry e42446600e [FIX] mail: Update legacy arguments for services.action.doAction
Emails could not be resent from the chatter after failing to be sent.
This was due to parts of code not being updated after a refactoring of OWL.

Multiple other instances of non-updated code are updated here.

Task-2887153

closes odoo/odoo#94529

X-original-commit: 8fbdb1b52b9051e92e4980d5af73460a46fe70da
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-24 15:00:48 +02:00
Nikunj Ladava 261fd732f8 [IMP] mail: add a node option for custom onchange debounce delay
This commit introduces a node option 'keydown_debounce_delay' on the
character field and on emoji mixin, so that use can define the custom
debounce delay (in milliseconds) instead of fixed 2000 ms for
triggering an onchange on the field. Note that this delay will be
applied only when 'onchange_on_keydown' node option is also provided.

Also, we've utilized the odoo's debounce instead of the one provided by
underscore js, for 2 reasons:

1 - odoo's debounce is already well tested (see the file
    /web/static/tests/core/utils/timing_tests.js)
2 - to take a step forward for reducing external lib dependency

task-2821978

closes odoo/odoo#94486

X-original-commit: ab80cdc0809e1347d201f21ac9474e66e9270f94
Related: odoo/enterprise#28822
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 10:30:00 +02:00
Achraf (abz) be1076e71a [REV] mail: Don't hide activity dropdown when clicking on feedback form
revert of https://github.com/odoo/odoo/pull/91209

Steps:
    - Go to CRM, kanban view
    - click on "Planned" button
    - click on "Mark as done" button
    - click on "Write Feedback" textarea

The activity dropdown disappears immediatly

opw-2884875

closes odoo/odoo#94470

X-original-commit: f59dab2ed666d5a71eb84d53c50bcdd15e264d96
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-06-24 09:26:01 +02:00
Alexandre Kühn 634eb85a97 [IMP] mail, knowledge: mark Emoji(List) component as Legacy
This commit duplicates the components Emoji and EmojiList into
other components called "LegacyEmoji" "LegacyEmojiList".

We do this so that we can implement the new EmojiPicker in Discuss
code, without affecting the code of `knowledge` during development.

When the Emoji Picker is in a good state with just the scope of
feature of Discuss, then we can integrate this new Emoji Picker
in other modules, like `knowledge`.

Task-2890268

closes odoo/odoo#94254

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-23 11:15:54 +02:00
Sébastien Theys cb26712c52 [IMP] mail: move _updateChatterContainerTarget to _updateView
The call in `_renderNode` is too early and appears to do nothing. It has been
moved to `_updateView` (coming from enterprise).

Part of task-2871070

closes odoo/odoo#94188

Related: odoo/enterprise#28691
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-21 19:03:23 +02:00
Sébastien Theys 6f21575b18 [IMP] mail: move creation of _chatterContainerTarget in init
Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:23 +02:00
Sébastien Theys 10d9c56f8d [IMP] mail: rename $chatterContainerHook and avoid jquery
Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:22 +02:00
Sébastien Theys 8e08340ff2 [IMP] mail: use hasChatter instead of _chatterContainerTarget
This allows removing unnecessary method and removes coupling between concepts.

Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:22 +02:00
Sébastien Theys 51e1f45313 [IMP] mail: move _isChatterAside definition to community
This allows removing overrides of other methods using it from enterprise code.

Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:22 +02:00
Sébastien Theys ffcd256d50 [IMP] mail: move _makeChatterContainerTarget code into caller
Now that the method no longer requires an override in enterprise, it doesn't
need to exist as a separate method.

Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:21 +02:00
Sébastien Theys 22293929c0 [IMP] mail: move _updateChatterContainerTarget in community
This allows reducing the complexity of overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:21 +02:00
Thanh Dodeur 259cb3a9bd [REF] mail: cleanup the CallView template
part of task-2692836

closes odoo/odoo#94035

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-21 15:41:50 +02:00
Thanh Dodeur 8805558f0b [IMP] mail: reposition the CallActionList of the CallView
This commit moves the `CallActionList` of the `CallView` so that it sits
below the main card view but not below the sideBar.

part of task-2692836

Part-of: odoo/odoo#94035
2022-06-21 15:41:50 +02:00
Thanh Dodeur 12326de30f [REF] mail: create CallSidebarView component and model
Move the sideBar part of the `CallView` to its new model and component.

part of task-2692836

Part-of: odoo/odoo#94035
2022-06-21 15:41:49 +02:00
Sébastien Theys 19f48283d2 [IMP] mail: reorder methods in form renderer override
Overridden methods from Form view are separated from custom mail methods, and
are sorted according to their call in the lifecycle.

This will make it easier to understand the file, in preparation to clean it
further.

Part of task-2871070

closes odoo/odoo#94140

Related: odoo/enterprise#28655
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-21 14:33:37 +02:00
Sébastien Theys 3332bff665 [IMP] mail: clean up main attachment js model
Part of task-2886642

closes odoo/odoo#93895

Related: odoo/enterprise#28532
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 18:56:19 +02:00
Sébastien Theys a6d6a71fdf [IMP] mail: only send thread to chatter rendered
As a first step clean up, attachments can be read directly from thread instead.

Part of task-2886642

Part-of: odoo/odoo#93895
2022-06-20 18:56:18 +02:00
Sébastien Theys 0c30945d36 [IMP] mail, *: clean up attachment format and isolate legacy calls
* = im_livechat, portal, portal_rating, test_mail

Part of task-2886642

Part-of: odoo/odoo#93895
2022-06-20 18:56:18 +02:00
Audric Onockx (auon) f07439fbc8 [FIX] mail: display follower subtypes order by sequence
Before this fix, follower subtypes were displayed by order of id,
whereas in DiscussController.read_subscription_data(),
it was ordered by :
\- parent_mode
\- res_mode
\- internal
\- sequence

See : https://github.com/odoo/odoo/blob/fc115ebdf7c3783f9eaabba71eccce23c676d957/addons/mail/controllers/discuss.py#L471-472
In this commit, we just reproduce the same order.

Also, for `parentModel` and `resModel`, we want the record
with their values unset to come first.
We added 'undefined-first',
as this sort order might be needed for other models.

closes odoo/odoo#93315

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 17:57:38 +02:00
Sébastien Theys ba59359420 [IMP] mail: make sort methods more reliable with unexpected types
Part-of: odoo/odoo#93315
2022-06-20 17:57:38 +02:00
Sébastien Theys 4d41afd0ef [IMP] mail: rename PartnerImStatusIcon to PersonaImStatusIcon
Now that it potentially contains guests, the previous name is no longer correct.

Part of task-2883466

closes odoo/odoo#93731

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-17 14:14:33 +02:00
Sébastien Theys 0e8b1721b5 [IMP] mail: introduce Persona model for guest and partner
And use it on partner im status.
This will allow displaying the im status of guest without any other change to
components.

Part of task-2883466

Part-of: odoo/odoo#93731
2022-06-17 14:14:33 +02:00
Sébastien Theys e8023a1c89 [IMP] mail: introduce PartnerImStatusIconView model
In preparation to move common code of guest and user to dedicated model.

Part of task-2883466

Part-of: odoo/odoo#93731
2022-06-17 14:14:32 +02:00
Sébastien Theys c0d8ed8196 [IMP] mail, hr_holidays: adapt im_status test to use real code/data
In preparation of refactoring the component to include guest.

Part of task-2883466

Part-of: odoo/odoo#93731
2022-06-17 14:14:32 +02:00
Louis Wicket (wil) d91f7852db [IMP] mail, *: user settings improvements
* = im_livechat, test_discuss_full

Various improvements to user settings, including:

+ Introduce new js models `res.users.settings` and `res.users.settings.volumes`
to mirror the python models.
+ Avoid reformatting server data and simplify the way notifications are handled.
+ Clean dead code (unused convertData).
+ Reword and add documentation.

closes odoo/odoo#93390

Related: odoo/enterprise#28291
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-17 14:14:14 +02:00
Nemael fd62f9f9ce [IMP] mail: introduce EmojiCategory model
This commit introduces the EmojiCategory model

Part of Task-2365687

closes odoo/odoo#93117

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-16 19:33:00 +02:00
Alexandre Kühn d75325014c [FIX] mail: apply SCSS of CallDemoView
Follow-up of https://github.com/odoo/odoo/pull/93330

Commit above renamed "MediaPreview" to "CallDemoView".
However, it mistakenly did not rename the SCSS rules that
referred to `o_MediaPreview`.

As a result, some styles were no longer applied, like buttons
being an overlay on top of camera stream.

closes odoo/odoo#93724

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-15 19:17:10 +02:00
Carlos Valverde ff471a252c [IMP] mail: discuss design revamp
Current design, especially related to views in small viewports, has
been revamped in order to increase readability and to be more coherent
with the one in large screens.

Task-2813949

closes odoo/odoo#87915

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-15 17:18:55 +02:00
Carlos Valverde 9cbbb02481 [REF] mail: discuss scss refactoring
Current SCSS is replaced with global Bootstrap classes, in
order to reduce code lines and to increase performance.

Task-2813949

Part-of: odoo/odoo#87915
2022-06-15 17:18:55 +02:00
Carlos Valverde 11182f3479 [IMP] mail: discuss dead code removal
This commit removes code which is no longer used in the current
component.

Task-2813949

Part-of: odoo/odoo#87915
2022-06-15 17:18:54 +02:00
Laurent Desausoi (lade) 4272374505 [FIX] mail: properly place dropdowns in Kanban Activity views
For the kanban_activity view (e.g.: in the CRM module), when we have enough
entries to require the scrolling, dropdowns are not displayed at the correct
location.
Furthermore, in kanban views, when dropdowns are opening on the edge of the
parent element (e.g.: in Documents), the dropdowns are partially hidden and not
accessible by the client.

Step to reproduce the issue:
1) Install CRM and Documents module
2) Go to CRM and create multiple leads with at least one activity
3) Go to the Activity view and scroll down and click on an item. The dropdown
is not placed at the correct location -> BUG 1
4) Go to the Documents modules and check the activity (the small clock icon)
of a Document on the right most column. The dropdown is hidden by the
description of the file.

Solution: Firstly, the parent container of the Kanban Activity view did not had
the `overflow: auto` property activated. Consequently, while the children were
somehow taking all the spaces of the screen, Popper (the third party that
handles the dynamic positioning of the dropdowns) was wrongly computing the
positionning.
Secondly, dynamically creating the dropdown via Javascript (through the
JQueryInterface of the Dropdown class in Bootstrap) somehow allows to fix the
issue in Documents. Consequently, it is important to keep them into the
Javascript and not move the arguments into the XML.

opw-2827873

closes odoo/odoo#93661

X-original-commit: 38fa6a70b70dac0d511be7952c496a5178f9c40e
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
2022-06-15 10:00:25 +02:00
Thanh Dodeur b7b4697a85 [FIX] mail: properly display the call systray menu
Before this commit, since the removal of the modelManager from the
scope of some components, the call systray menu would never show up
as messaging was never defined.

closes odoo/odoo#93616

X-original-commit: ab13e5a8649d82c985163cd82f0c43e4975afca7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-14 18:26:39 +02:00
Alexandre Kühn d4bd8e7cc6 [FIX] mail: guard MessageSeenIndicatorView/messageSeenIndicator
Follow-up of https://github.com/odoo/odoo/pull/88950

Commit above introduced `MessageSeenIndicatorView`.

Conceptually, `MessageSeenIndicatorView/messageSeenIndicator`
is required. However, the current implementation make it
possible to have a view without the related pure logic record.

This commit simply guards the template to take this implementation
detail into account, as to not make it crash.

Note that future changes in modelling will enforce
`MessageSeenIndicatorView/messageSeenIndicator` being required, so
that we won't need to guard it in template. But this is a fix in
stable version, so it's safer to keep minimal code changes.

closes odoo/odoo#93599

X-original-commit: 495379b20c077ab27b91850673222893e0d14a8e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-14 17:14:05 +02:00
Zelong Lin fac8cb5486 [FIX] discuss: issue with click on im_status
task-2882007

closes odoo/odoo#93588

X-original-commit: 8161d2588b091fb45f8d7af450bb6a0b1b2d4bfb
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-14 16:00:02 +02:00
Thanh Dodeur 430d66b94e [REF] mail: change field names to fit conventions
`callViewOfMainCard` -> `callViewAsMainCard`
`callViewOfTile` -> `callViewAsTile`

part of task-2692836

closes odoo/odoo#93550

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-14 12:47:37 +02:00
Thanh Dodeur b3c3a8123d [REF] mail: cleanup layout files
part of task-2692836

Part-of: odoo/odoo#93550
2022-06-14 12:47:37 +02:00
Louis Wicket (wil) 0afb923e8e [FIX] mail: remove obsolete and invalid use of state
Change forgotten references to `state` to references to the record.

Fix crash introduced in https://github.com/odoo/odoo/pull/93330/

closes odoo/odoo#93556

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-14 11:41:34 +02:00
Aurélien Warnon ee6d0d8c83 [IMP] mail: cleanup '_htmlEscape' usage
We instead use the standard owl.utils.escape.
This allows having less custom implementations of escaping and rely on existing
tools.

Task-2622893

closes odoo/odoo#81293

Related: odoo/enterprise#22850
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-14 10:35:45 +02:00
Luis González ac8f6ad9d1 [FIX] mail: missing ARIA attributes after OWL
After the refactor performed on 3fea5b213 to start using OWL, a lot of
aria attributes were lost.

ARIA attributes are required to ensure good compatibility with asistive
technologies and keyboard users.

This commit reintroduces such attributes, which include:
- `aria-label`: used for elements with title but no text
- `role`: mainly used for elements that behaves as buttons or links
- `aria-expanded`: used on buttons that toggle menus or content, e.g.
  button to open attachments or followers
- And another ones like `aria-pressed`, `tabindex`, etc

closes odoo/odoo#93506

X-original-commit: 35442d9b4102b56421417fc03a686ff916e87bb1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 22:51:55 +02:00
Alexandre Kühn 60f5c1ab3a [IMP] mail: remove shift left/right actions on chat window header
Task-2882557

closes odoo/odoo#93484

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 22:51:42 +02:00
Sébastien Theys 8104140f40 [FIX] mail: auto reload form on attachment changed through activity
Before this commit the feature to auto-reload on attachment changed only worked
through composer or attachment box, now also works with "upload file" activity.

closes odoo/odoo#93486

X-original-commit: 4ab3cb40b09f2c7278bea3bf1136b9ebf6dadc0e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-13 21:39:17 +02:00
Sébastien Theys d9c25be92f [IMP] mail: introduce Channel and ChannelMember model
task-2832456

closes odoo/odoo#91918

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 17:58:22 +02:00
Alexandre Kühn 190feb8d6d [IMP] im_livechat, *: make JS models available in livechat external lib
This commit make messaging service available in the frontend and in
the livechat external lib bundle.

This is preparation to refactoring JS livechat to use models and OWL.

*: bus, mail, survey, web, website_livechat

Task-2870899

closes odoo/odoo#92786

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 16:51:27 +02:00
Alexandre Kühn e73b89cdb0 [MOV] mail: rename 'MediaPreview' to 'CallDemoView'
Task-2871939

closes odoo/odoo#93330

Related: odoo/enterprise#28274
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-11 02:15:15 +02:00
Alexandre Kühn 751affdb8a [IMP] mail: rename 'MediaPreview' to 'CallDemoView'
Task-2871939

Part-of: odoo/odoo#93330
2022-06-11 02:15:15 +02:00
Alexandre Kühn dcfc8a91e8 [IMP] mail: Introduce view models
This commit moves code from components to models,
by introduce some models and fields.

It also cleans a few things in models, like:
- use Timer model instead of setTimeout
- replace local variables by model fields

Task-2881075

All changes:
- [IMP] mail: remove ChannelMemberListCategoryComponent/channelMemberListView
Task-2831082
- [IMP] mail: introduce ChannelMemberListCategoryView/members
Task-2864112
- [IMP] mail: introduce ChannelMemberListCategoryView/title
Task-2864115
- [IMP] mail: introduce ChannelMemberView
Task-2864119
- [IMP] mail: introduce 'Chatter/attachmentsLoaderTimer'
Task-2868781
- [IMP] mail: introduce 'MessageView/highlightTimer'
Task-2868794
- [IMP] mail: introduce 'CallView/showOverlayTimer'
Task-2868867
- [IMP] mail: introduce RtcSession/broadcastTimer
Task-2868929
- [IMP] mail: introduce CallView/tileContainerRef
Task-2871859
- [IMP] mail: introduce CallView/tileWidth
Task-2871869
- [IMP] mail: introduce CallView/tileHeight
Task-2871878
- [IMP] mail: introduce ChatWindowManager/endGapWidth
Task-2871960
- [IMP] mail: remove unused CallView/columnCount
Task-2871885
- [IMP] mail: introduce ChatWindowManager/hiddenMenuWidth
Task-2871963
- [IMP] mail: introduce CallView/calculateTessellation
Task-2871867
- [IMP] mail: replace model methods of MediaPreview by record methods
Task-2871934
- [IMP] mail: introduce ChatWindowManager/betweenGapWidth
Task-2871956
- [IMP] mail: introduce ChatWindowManager/chatWindowWidth
Task-2871957
- [IMP] mail: introduce ChatWindowManager/startGapWidth
Task-2871965
- [IMP] mail: introduce ChatWindowManager/availableVisibleSlots
Task-2871971
- [IMP] mail: introduce ChatWindowManager/visual/hiddenChatWindowLocalIds
Task-2871980
- [IMP] mail: introduce ChatWindowManager/visual/isHiddenMenuVisible
Task-2871981
- [IMP] mail: introduce ChatWindowManager/visual/hiddenMenuOffset
Task-2871984

Part-of: odoo/odoo#93330
2022-06-11 02:15:15 +02:00