Commit Graph
4101 Commits
Author SHA1 Message Date
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
tsm-odoo e97214ff4e [IMP] mail, *: remove createMessagingMenu during tests
*: im_livechat, test_mail, test_mail_full.

The createMessagingMenu helper was used during tests to mount
the messaging menu and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's instanciate a webClient and a systrayService
for the messagingMenu to be present at all time.

closes odoo/odoo#94301

Related: odoo/enterprise#28747
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-22 16:32:42 +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
tsm-odoo b575fa53a7 [FIX] web, *: fix scroll tests
*: mail, point_of_sale, test_mail_full.

The alt of images can be displayed slightly after the programatic
scroll which means the scroll height we set and the one we assert
are slightly different (the client height have changed). In order
to solve this issue, all alt attributes are replaed by data-alt
during tests. The src attribute is removed as well to make sure
images won't trigger a GET request on the server.

closes odoo/odoo#94092

X-original-commit: 0446923db6b7376ee2c27e3f6e94b5f8e43a14fb
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2022-06-21 11:20:20 +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
Rahul Prajapati 71a68c5923 [IMP] *: remove support for empty create with pyenv
* hr, im_livechat, mail, sms, snailmail, test_mail_full, website_livechat,
  website_slides

PURPOSE:

Creating a record with no values has no sense but is sometimes useful during
tests.
The support should be dropped for `default` parameter in `create`.

SPECIFICATION:

All the occurrences of `create()` have been replaced by `create({})`.

Task-2869394

closes odoo/odoo#93917

Related: odoo/enterprise#28538
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-20 15:31:51 +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
Aaron Bohy a715e63b88 [IMP] mail,web: tests: crash if triggerEvent called on invisible el
Before this commit, the test utils that trigger an event (e.g.
click) didn't check whether the target of the event was visible.
As a consequence, when writing a test, one might trigger an event
on an invisible and undesirable target, and don't understand why
it doesn't work due to the absence of feedback. This commit
improves that situation by throwing an error in those sitations.

Obviously, some tests relying on the former behavior needed to
be slightly adapted.

closes odoo/odoo#93549

Related: odoo/enterprise#28360
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-06-14 22:07:08 +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
Sébastien Theys 0b78c1d5c1 [FIX] mail: properly await createThreadViewComponent
Inner `afterNextRender` could potentially resolve/reject after the test has
already ended due to missing await (arrow function with bracket is sync).

This will prevent tests from overlapping each other.

closes odoo/odoo#93505

X-original-commit: c5d0cc3f37693346fce5e72b618d5e3454d118c4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 22:51:52 +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
tsm-odoo 5bdf2a4e45 [IMP] mail, web: dont patch window in patchUiSIze
Patching the window object is not robust and can lead to errors.
In order to make patchUiSize more robust, patching of window have
been replaced by a patch of the uiService.

closes odoo/odoo#93355

X-original-commit: 46be08a551ead8d2e0304a753af3d3b13744e6ed
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 11:33:31 +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
Sébastien Theys eca952307a [FIX] mail: correct unlink in _mockMailThreadMessageUnsubscribe
closes odoo/odoo#93354

X-original-commit: 6bcf70d3f51d66861f5ec2f0e769c14a091e5ddf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-11 01:13:54 +02:00