Commit Graph
4697 Commits
Author SHA1 Message Date
tsm-odoo 0c919774ea [FIX] mail: fix non-deterministic message test
Before this PR, the `Updating the parent message of a reply also
updates the visual of the reply` test was failing in a non-deterministic
fashion.

This PR fixes this issue by replacing the `nextTick` by a  specific
`waitUntil` in order to ensure the DOM is properly updated before
asserting.

Fixes 20829 runbot issue.

closes odoo/odoo#120273

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 15:59:13 +02:00
Alexandre Kühn 9cfb6fe471 [FIX] mail: no scroll on small chatter
Before this commit, when chatter message list was lower
than 2500px, the message-list had scrollable of 2500px
of height.

This happens because the area detecting present time was
always 2500px. thus making the content have this value as
scrollheight.

This commit fixes the issue by making presence area not
go above the conversation height. So if message list is
250px of height, then presence area is 250px, not 2500px.

closes odoo/odoo#120173

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 14:47:31 +02:00
FrancoisGe 91111f33ef [REF] web: dynamicInfo domain becomes a function
In commit 2ecfed335d, we made the decision
to pass the domain to the field during extracProps with a getter in dynamicInfo.
This strategy causes the domain to be evaluated for all fields using it
in their extractProps. Very often we want to evaluate the domain on
an event, for example when a m2o is clicked on. The permanent evaluation
when using the widget therefore implies an unnecessary computational cost
for the evaluation and prevents the use of field.domain as a default value,
as it may be present in readonly views which never need the domain to be evaluated.

We will therefore convert the getter domain into a function that can be
called when we need the domain to be evaluated. This allows us to avoid
unnecessary evaluations and we can use field.domain as the default value
in the dynamic.domain.

closes odoo/odoo#120061

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 13:33:28 +02:00
Alexandre Kühn e155eda05c [FIX] mail: no crash when mentioning partner after channel mention
Steps to reproduce:
- Open channel general
- type "#" in composer so it prompts "#general"
- delete "#"
- type "@" in composer

This happens because the partner suggestion part relies on raw server
data in model thread, `thread.channel`, which is erased from the
channel suggestion. This was used to detect whether partner is member
or not, in `thread.channel.channelMembers`.

This commit fixes the issue by making partner suggestion relies on
more reliable data in models, `thread.channelMembers`.
`thread.channel` is deprecated, and will eventually be removed.

closes odoo/odoo#119935

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 13:33:17 +02:00
Sébastien Theys 09ac15e2dd [REF] mail: clean code for message update
As a bonus, add cross-tab update for current user in chatter.

Part of task-3265211

closes odoo/odoo#120018

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 12:26:43 +02:00
Didier (did) 19abfc1f66 [IMP] mail: update link previews when editing a message
Before this PR, link previews where not updated when a user was editing a
message.
This clear the current link previews and reprocess the updated message.

closes odoo/odoo#119917

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 18:25:13 +02:00
Sébastien Theys c1a3ad8e01 [REF] mail: move channel specific code of reaction to discuss
The opportunity is taken to clean the methods to make the override
actually possible.

Part of task-3265211

closes odoo/odoo#119942

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 17:21:53 +02:00
Bruno Boi f22961ad07 [FIX] web,*: repair root class attr
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
   loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
   web_tour

**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.

Examples:

<form class="foo">...</form>

    gives

<div class="o_view_controller o_form_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="foo o_form_editable ...">...</div>
    </div>
</div>

and

<list class="foo">...</list>

    gives

<div class="o_view_controller o_list_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="o_list_renderer foo ...">...</div>
    </div>
</div>

**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8

**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
  the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
  "o_form_renderer" class, which was removed during the recent form view
  refactoring.
- the list renderer no more adds the root node class attribute to its
  "o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
  classnames derivated from the arch root node, an util has been
  introduced to avoid duplicating code
- the whole codebase has been checked and adapted.

Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-04-27 16:10:30 +02:00
Jan Brodersen (Armitxes) 5d5099a0f5 [FIX] mail: No crash from "enumerateDevices" in discuss calls
Before this commit, when accessing the discuss call settings
in non-localhost without SSL, there was the following crash:

```
"Cannot read 'enumerateDevices' of undefined"
```

Odoo uses zxing-js to detect devices within the discuss app.
zxing-js provides methods such as "hasNavigator",
"isMediaDevicesSuported" or "canEnumerateDevices" to check if
features are available. These are not called by Odoo before using
the related features what can result in a JS traceback.

This commit fixes the issue by showing a warning as a toaster
notification and in the dev tools, instead of a traceback.

The zxing-js methods are not exposed, hence the reliance on
truthy mediaDevices.

See also https://github.com/zxing-js/library/issues/225

Closes https://github.com/odoo/odoo/issues/112255
Closes https://github.com/odoo/odoo/pull/112813

closes odoo/odoo#119903

X-original-commit: 32238dd680396c6ccb519aa8b3fb7487c38395f7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 12:31:39 +02:00
luvi 894090914e [IMP] web, *: add supportedOptions documentation as field metadata
*: mail, mass_mailing, sms, web_editor

This commit adds a new supportedOptions attribute that can be added to any
field widget metadata object. This documentation can be used from other places
(Studio for example) by getting the field from the registry and then read
this key. This attribute can contain an array, detailing the list of available
options for the field widget.

By using an array, it can be ordered easily without having an object with keys
unalphabetically. Ordering the options can make sense, especially when two
options are tied to each other, it is easier to group them one after the other.
(eg: 'start_date' first, then 'end_date')

Each option documented is an object and has the following attributes:
- help: contains more details on the current option and its use
- name: name used in the options object from the node
- label: a label with a more explicit name than the option name
- type: the type of value that must be used as a value (string, boolean, selection, field, domain)
- choices: for options with a 'selection': can be used to know available values
  where multiple values can be chosen as the value. This must be
  an array containing the options.
- availableTypes: for options with a 'field' selection: can be used to filter the
  available fieldNames to choose as a value.
- default: the value that is used by default, when the option is not set
  in the options

task-3259617

closes odoo/odoo#118713

Related: odoo/enterprise#39847
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-27 11:21:09 +02:00
Alexandre Kühn f1566d4d2d [MOV] mail,*: move static discuss/ to discuss_app/
*: im_livechat, website_livechat

In preparation of splitting 'discuss' and 'mail' modules.

This allow using new folder discuss/ that contains all static
files of new module 'discuss'.

Part of task-3265211

closes odoo/odoo#119860

Related: odoo/enterprise#40388
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 07:06:02 +02:00
Alexandre Kühn 66301a4ac6 [FIX] mail: new needaction message from chatter in messaging menu
Before this commit, when receiving a new needaction message from
chatter, the messaging was not updating itself to show this new
needaction.

closes odoo/odoo#119843

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 07:05:57 +02:00
Sébastien Theys b1772094b1 [REF] mail: move discuss.channel code to its own folder (models)
This commit focuses on removing all references to discuss.channel from
code located in /models of mail module.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119413

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-26 19:49:08 +02:00
Alexandre Kühn cdf456ea00 [FIX] mail: properly handle discuss active_id 'discuss.channel_'
Before this commit, when loading discuss app with
`active_id=discuss.channel_1` in URL, the discuss app did not
auto-select the conversation.

This happens because the code did not parse model and id part of
"discuss.channel_1": it split into `discuss.chann` and `l_1`,
instead of `discuss.channel` and `1`. This comes from splitting
the same way as legacy `mail.channel`, starts with 13 characters,
although there are now 16 characters in `discuss.channel`.

This commit fixes the issue by simplify the way the active thread
of discuss is deduced from active_id.

closes odoo/odoo#119559

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-25 15:20:49 +02:00
Louis Wicket (wil) 03aada713a [IMP] mail: hold shift to select emoji without closing the picker
Clicking on an emoji from the emoji picker while holding down the Shift
key now prevents the emoji picker from closing, allowing users to easily
select multiple emoji in one go.

Task-3288704.

closes odoo/odoo#119598

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-25 14:07:38 +02:00
Didier (did) 95b6b91fca [IMP] mail: better typing for composer and use Ref typedef
This PR complete the type definition for the props of the composer and replace
the custom Object by Ref type in the relevant place.

closes odoo/odoo#119593

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-25 14:07:30 +02:00
Julien Carion (juca) eaacaf122d [IMP] web, *: Add autoresize hooks
This commit adds two autoresize hooks for text inputs and textareas to
make it adapt their size (width for text inputs, height for textareas)
depending on their content.
The commit therefore solves the issue of several form view task titles
being restricted to 1 line while it can be annoying if the title is too
long. The autoresizeTextarea feature was moved from TextField to the
autoresizeTextarea hook and the autoresizeInput feature was moved from
the AutoresizeInput mail component to the autoresizeInput hook.
The TextField component has a new option for disabling linebreaks.

task-3138826

closes odoo/odoo#117355

Related: odoo/enterprise#39493
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 14:07:15 +02:00
Sébastien Theys 694d501a35 [REF] mail, im_livechat: move /mail/chat_post to im_livechat
It is only used there.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119306

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-24 18:25:59 +02:00
Thanh Dodeur 74af371bc9 [FIX] mail: prevents crash when trying to close the audioContext
Before this commit, since https://github.com/odoo/odoo/pull/119014,
the audio context could be closed when already.

Until the implementation of AudioContext.state*, we have to catch the
error.

This commit also removes the forwarding to the destination that was
not necessary.

`* https://webaudio.github.io/web-audio-api/#widl-AudioContext-state

closes odoo/odoo#119444

X-original-commit: 0d28d067d2b848701312deea419acc3fe68ab4c9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-23 00:51:12 +02:00
Alexandre Kühn f34c5c64f8 [FIX] mail: save record on schedule activity
Before this commit, when adding a tag on record and then
scheduling an activity, the tag was removed from the record.

This happens because reloading the chatter does not save changes.

Although there is a `keepChanges: true` option, this looks
ineffective. This commit fixes the issue by letting chatter reload
always save any changes.

closes odoo/odoo#119275

X-original-commit: 97465dfb0ec53080bf05c3614dfa7429629729a6
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-21 23:46:21 +02:00
Sébastien Theys 90cb44e1e1 [REF] mail, *: rename mail.channel to discuss.channel
* = bus, calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot,
    mass_mailing, privacy_lookup, test_discuss_full, test_mail,
    test_mail_full, website_crm_livechat, website_livechat, base

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#118354

Related: odoo/upgrade#4553
Related: odoo/enterprise#39661
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-21 02:21:53 +02:00
Alexandre Kühn 97fd1d7058 [FIX] mail: make precisely text of reply-to message clickable
Before this commit, clickable of a reply-to message mistakenly
extended all the way to the other end of the conversation.

closes odoo/odoo#119228

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-20 17:46:57 +02:00
Alexandre Kühn c8fe8cb668 [FIX] mail: better separate header and content of chat window visually
Before this commit, content inside chat window could visually fuse
with the header in a way that makes it hard to see the separation
between the header and the content.

This commit fixes the issue by adding a small border below header
when there is some content.

closes odoo/odoo#119173

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-20 14:10:29 +02:00
Alexandre Kühn 7995349001 [FIX] mail: correct breadcrumb when open discuss from chat window
Before this commit, when opening Discuss from chat window and then
accessing the settings page of a channel, the breadcrumb showed
"Unamed" as the name of the App instead of "Discuss".

This happens because the client action was not named when expanding
the chat window by opening Discuss app.

closes odoo/odoo#118939

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-20 11:57:31 +02:00
Pulinckx Pierre (PIPU) 608e90e998 [REF] *: Replace underscore functions by native JS
Replace _.map(), _.flatten(), _.delay(), _.contains(), _.pluck(), _.isUndefined(), _.isEmpty(), _.isString(), _.isEqual(), _.isBoolean(), _.memoize(), _.invoke(), _.bind(), _.escape(), _.debounce(),
_.str.sprintf(), _.str.repeat(), _.str.startswith(), _.str.trim(),
_.str.escapeHTML(), _.str.escapeRegExp(), _.str.startsWith(), _.str.include()

closes odoo/odoo#118012

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-04-20 11:57:29 +02:00
Thanh Dodeur c741bbb4a3 [FIX] mail: prevent potential memory leak of AudioContext
Before this commit,

The audio context used in media_monitoring was not
closed. Which could lead to memory leaks.

The source was not connected to the destination in the
script processor (used in old browsers that do not support
audioWorklets), which would prevent the monitored audio to be used as
an audio source.

closes odoo/odoo#119124

X-original-commit: f1c3f78dd6e17fe2a3f5a01d8510ca4343b880fe
Signed-off-by: Thanh Dodeur (tso) <tso@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-20 10:52:00 +02:00
Alexandre Kühn fa6fe90ee7 [FIX] mail: padding at end of other bubble in discuss chat window
closes odoo/odoo#119092

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-04-19 21:58:52 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello ebf646b44f [IMP] *: ModelFieldSelector improvements
We refactor the ModelFieldSelector and ModelFieldSelectorPopover
components.

We also improve a bit ModelFieldSelectorPopover:
    - on first page, the button to go back is no longer available
      (so that it is now more difficult to produce an invalid path)
    - we always start with a page presenting the model where the last
      selected field name belongs to
    - the keyboard navigation is improved
    - click on model field selector opens the popover with the focus in
      the search input (if any)
    - for relational fields in popover: the user can either click on the
      relational field (and select it) or a special button that make him
      follow the relation to the field comodel

We also refactor the hook useDynamicPlaceholder to make it use a new
component DynamicPlaceholderPopover that uses ModelFieldSelectorPopover.

Task ID: 3272798

closes odoo/odoo#117951

Related: odoo/enterprise#39673
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-19 21:58:34 +02:00
Didier (did) 6f12a849f6 [IMP] mail: link preview image as message
This PR hide the message body when the link preview is an image and the message
only contains the link to the image.

closes odoo/odoo#117772

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-19 20:58:14 +02:00
Alexandre Kühn 4fd9cfbe81 [FIX] mail: make chat window take whole height in mobile
Before this commit, chat window take at most 95% of global
height. This is ok in desktop, 5% room allow clicking on
systray menu. In mobile, however, the intend is for chat window
to take whole height.

This commit makes chat window take whole height in mobile, while
preserving the max-height 95% of global height in desktop.

Also fix an issue where chat window were foldable in mobile, when
this feature is desktop-only.

closes odoo/odoo#119058

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-19 19:14:47 +02:00
Didier (did) f5ff0b1b30 [FIX] mail: fix link preview overflow in the chat window
Before this PR, a link preview image would overflow out of the chat window. This
because the max-width on the image is bigger than the space dedicated to the
image inside the chat window.
This PR set the max-width to 100% inside a chat window, so the image cover the
space nicely.

closes odoo/odoo#119019

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-19 11:01:27 +02:00
tsm-odoo e55ba11a89 [FIX] mail: fix message separator appearing after showing composer
closes odoo/odoo#118875

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-18 19:28:50 +02:00
Pulinckx Pierre (PIPU) 800223ae7c [REF] *: Replace underscore _.each() by native JS
Replaced _.each() functions (average 235 occurences)

Description of the refactoring this PR addresses:

Current behavior before PR:

There are underscore.js function enumerated above used in odoo.

Desired behavior after PR is merged:

These functions has been replaced by native javascript
prototypes/methods/functions.

TaskId : 3246238

closes odoo/odoo#118565

Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-04-18 15:38:54 +02:00
tsm-odoo a2a4cd56ec [FIX] mail: fix reply to author avatar
This PR fixes a bug where the author avatar of the parent message of
a reply had the wrong avatar (the one of the  of the reply
author instead of the one of the parent message author).

closes odoo/odoo#118878

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-18 11:33:48 +02:00
Alexandre Kühn 79b30f13b8 [FIX] mail: border style of composer in edit message
closes odoo/odoo#118802

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-17 18:01:24 +02:00
Didier (did) f11ab40c3e [IMP] mail: rename update function and cleanup dead code
closes odoo/odoo#118793

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-17 16:35:06 +02:00
Nemael f80e2aad37 [IMP] mail: add banner on archived channels
This PR adds a banner on archived channels in detailed view
It also adds a banner on archived channels in kaban view, and
reduces the space available for description in case of banner.

Task-2494469

closes odoo/odoo#117619

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-17 15:18:51 +02:00
Alexandre Kühn 4d5516774d [FIX] mail: im status online color in community
Before this commit, im status in community was blue instead
of green.

This commit makes im status green in all version, as it should.

closes odoo/odoo#118744

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-17 14:14:22 +02:00
Alexandre Kühn 41e0543932 [FIX] mail: no crash on receiving link preview of non-known message
This notification makes sense when we know this message. If we don't
know it yet, then we should just ignore and receive data of link
preview when fetching the message.

closes odoo/odoo#118647

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-14 19:45:52 +02:00
zel-odoo 61cdeed774 [FIX] web,mail: wrong positon when content change
1. specify the Position for the usePosition();
2. fix chatter navigable list position;
3. usePosition() change;

closes odoo/odoo#118438

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 17:57:24 +02:00
Bruno Boi b4b834c0a9 [REF] web: simplify popover hook usage
**Before this commit**
Almost all of the use cases of the `usePopover` hook are dealing
with an abnormal amount of complexity:
- they have to store the closing function of the popover, and sometimes
  keep track to its opening state,
- you can find a duplication of a useUniquePopover hook, which is
  anyway the behavior that is always wanted for popover users.

This is due to the fact that usePopover is just some kind of wrapper
to the lower level popover service.

**After the commit**
- The usePopover now has a new API, which simplifies its usage.
- The useUniquePopover hook implementations have been removed and
  this "unique" behavior is now merged into usePopover
  and has become the standard one (not configurable).
- All of the use cases have been adapted, even the cases where
  components used directly the popover service (through `useService()`).

See the adapted jsDoc around the hook in popover_hook.js

closes odoo/odoo#118066

Related: odoo/enterprise#39654
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 16:40:19 +02:00
Bruno Boi e9aced9d53 [FIX] web: close popover on mousedown away
**Before this commit**
The popovers will close on click away.
This makes impossible to start selecting text within a popover
using the mouse and finishing the move outside of the popover
(as it will get closed).

**After this commit**
Popovers will close on mousedown away instead, which is a general
standard for user interfaces anyway.

Part-of: odoo/odoo#118066
2023-04-13 16:40:18 +02:00
Thanh Dodeur 945f3cce9c [IMP] mail: add rtc information to the member list
This commit adds call icons to the channel member list and
sorts this list as well as the call participant cards of the call view
based on call state (in call, raising hand, invited).

task-3251025

closes odoo/odoo#117995

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 15:26:27 +02:00
Jorge Pinna Puissant 38acd9f7d4 [FIX] mail, test_mail: Keep track of last update images
Since [1], a unique id is used for fieldNodes, therefore, the code to
keep track of last update images on the activity view needs to change
also.

Before this commit, we search the write_date on the fieldModes using the
id, and if it's not present, a new one is created using as id
"write_date".

Now, as a unique id is needed, we search using the name, and if it's not
present, a new one is created using as id "write_date_0".

Note that this is already the behavior on kanbanParse.

[1]: https://github.com/odoo/odoo/commit/baebb6a5b05ac8d59501a6071a5513e31a4ca047

closes odoo/odoo#118320

Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-04-13 04:08:53 +02:00
Louis Wicket (wil) c16bef413f [FIX] mail: adjusts member list separator to the locale
Prior to this commit, the separator used to separate the names of the
members of a group DM could not be translated. This is because the
string being translated is too short to be considered by the translation
system.

This commit fixes the problem by no longer relying on the Odoo
translation system and instead using the ECMAScript Internationalization
API.

closes odoo/odoo#118306

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 04:08:45 +02:00
Alexandre Kühn 1a6c04211e [FIX] mail: emoji picker add() should not useRef
`useRef()` hook should only be used in `setup()` of component.
The `add()` function of emoji picker can be used anywhere.

This commit fixes the issue by limiting use of `add()` to pass
Object whose `el` is an element. We should pass the ref immediately
rather than the refName.

closes odoo/odoo#118293

Related: odoo/enterprise#39626
Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-13 04:08:30 +02:00
tsm-odoo 1c1604466f [IMP] mail, im_livechat: add pin messages feature to channels
With this commit, messages can be pinned on a channel and
chat conversation. There's a new menu listing all pinned
messages on a conversation, and we can jump to these messages
in the current conversation.

As this feature incentives to see older messages, this commit
also adds a "Jump to Present" button when looking at old messages.

closes odoo/odoo#116666

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 04:08:11 +02:00
Alexandre Kühn fc9d46f3b9 [REF] mail: clean message fetch code
Adapt code of message fetch so that fetching of
(needaction) messages are controlled in a way to
keep continuous sequence of messages at all time.

This code design solves the "holes" problem in a message
list by not allowing holes. This fixes many scenario that
generated these holes, resulting in unfetchable messages.

Example of such a scenario:
- post 40 messages
- post a new message that is reply of the oldest message
- page reload and scroll up until load more
=> 10 messages are missing in-between replied message and
 following message (that should have been 11 messages apart)

This code also prepares for allowing jumps in a conversation.

Part-of: odoo/odoo#116666
2023-04-13 04:08:11 +02:00
damr bceab17e68 [FIX] mail: prevent a traceback when an onclick is triggered on an empty
m2o avater user widget

This commit's purpose is to prevent a traceback when the user click on
an empty avatar user icon.

task-3254564

closes odoo/odoo#117374

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-12 14:02:27 +02:00
Alexandre Kühn 5293827949 [FIX] mail: no white leak on rounded border of chat window
Before this commit, in white theme, chat window rounded borders
had some white color leak.

This comes from background color of chat window, which is white,
while the header background color is purple.

This commit fixes the issue by setting the chat window background
color to purple. The content now defines its own color, and the
header just inherit from the chat window background color.

This commit also fixes a bug where the chat window hidden menu
items were below visible chat windows.

closes odoo/odoo#118242

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-11 18:49:43 +02:00