Commit Graph
4381 Commits
Author SHA1 Message Date
tsm-odoo a6c7739191 [FIX] mail: fix message unread counter
This PR fixes several issues with the unread counter:
- Notifications being considered as unread messages (which is not
the case on the server side which resulted in inconsistencies).
- Counter greater than it should be when the last seen message is
not loaded.
- Messages not marked as read on first thread opening.

task-3239957

closes odoo/odoo#116208

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-24 06:45:56 +01:00
FrancoisGe 2ecfed335d [REF] *: extractProps receive dynamicInfo
Before this commit, the use of multiple <field> with the same name in a
view was not well supported.

Why was this?
Some Field components need to know information related to the <field>
such as context, domain, required and readonly. The solution used before
this commit to access this information is to use the getFieldContext,
getFieldDomain, isReadonly, isRequired functions of the model.
Unfortunately, these only take into account the last occurrence of the
<field> because the model is not aware that the same field is present
several times on the view. The information must therefore not come from
the model. For example, it was not possible to have the same field
twice with 2 different domains. It will use the domain of the last
field for both.

Solution:
We will add the object "dynamicInfo" to the fieldInfo passed to the Fields
extractProps function. This object will contain a getter to get the value
of required, readonly, domain and context for the current <field>.
If a Field needs one of its information, it will just have to get it
from extractProps.

Part of Task: 3179751

closes odoo/odoo#115197

Related: odoo/enterprise#38151
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-24 01:24:48 +01:00
tsm-odoo 08278d582b [FIX] mail: crash when message has no author
This commit fixes a crash that occured when a message has
no author. The author avatar url was assuming an author
would always be given while it is not the case.

closes odoo/odoo#116306

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-23 21:13:05 +01:00
Alexandre Kühn d07f29613d [FIX] mail: emoji picker category selection should not cut emoji
closes odoo/odoo#116254

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 21:47:49 +01:00
Alexandre Kühn 9f61697411 [FIX] mail: smaller follower subtype dialog
closes odoo/odoo#116251

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 21:47:46 +01:00
Alexandre Kühn 8a2a7f2dd4 [FIX] mail: chatter takes whole width in marketing app
closes odoo/odoo#116249

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 20:46:57 +01:00
Alexandre Kühn 5bc42ddc32 [FIX] mail: no member-list and settings buttons on folded chat window
They make sense when the chat window is unfolded,
as it changes the content. But when folded, the buttons have no
visible affect. Better hide them in that case.

closes odoo/odoo#116242

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 19:44:44 +01:00
Alexandre Kühn e9db06c106 [FIX] mail: use 24-hour format for squashed message timestamp
closes odoo/odoo#116216

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 18:08:59 +01:00
tsm-odoo 7eab007771 [FIX] mail: do not allow click on message delete dialog
Since the discuss refactoring, clicks are not disabled in the message delete dialog.

This commit fixes the issue.

closes odoo/odoo#116215

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 17:03:52 +01:00
Alexandre Kühn fb34115b81 [FIX] mail: less spacing in composer suggested recipient
closes odoo/odoo#116213

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 17:03:49 +01:00
Alexandre Kühn 64f9693407 [IMP] mail: recent emoji in emoji picker
Task-2982627

closes odoo/odoo#116067

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 17:03:42 +01:00
Alexandre Kühn b84ee02e01 [FIX] mail: more readable placeholder in activity popopver
closes odoo/odoo#116210

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 15:59:18 +01:00
Louis Wicket (wil) 10716e4837 [FIX] mail: allow accurate translation by providing full context
closes odoo/odoo#116195

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 14:52:44 +01:00
Alexandre Kühn e8f074cdae [FIX] mail: editing message should take whole width
closes odoo/odoo#116158

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 14:52:28 +01:00
Alexandre Kühn b1a610958f [FIX] mail: gold color for starred message
closes odoo/odoo#116155

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 14:52:25 +01:00
tsm-odoo 55f06fd5aa [IMP] mail: no new message separator when posting a message
This commit removes the "new message" separator when posting a
message on a channel.

At the same time, this commit solves an issue that caused messages
to flicker when the message came from the bus before the answer of
the rpc.

In order to do so:
-  messages are marked as read immediately after
`message_post` for the member of user that posted it.
- a temporary id is passed to `message_post` in order
to reconcialiate temporary/server messages.

task-3232911

closes odoo/odoo#116085

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 14:52:13 +01:00
tsm-odoo 14b0da3d0a [IMP] mail: mark message as unread
task-3232911

Part-of: odoo/odoo#116085
2023-03-22 14:52:13 +01:00
Nemael 041e5b3629 [FIX] mail: css improvements on chatter
This commits makes some improvement on the chatter visuals

-Spacing/styling of various elements
-Missing borders around chatter

closes odoo/odoo#116039

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 11:06:49 +01:00
Thanh Dodeur d0657e1757 [FIX] mail: call do not keep the camera stream when switching to display
Before this commit, trying to share screen while using the user video
(webcam) wouldn't work because the old stream was kept instead of
trying to obtain a new one.

This commit fixes this issue, does a small cleanup of `rtc_service.js`
and adds tests related to streams.

closes odoo/odoo#116042

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 03:39:07 +01:00
Zelong Lin 3a5eb4567f [REF] mail: NavigableList Ref
closes odoo/odoo#116037

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 01:45:24 +01:00
Didier (did) 7da61eaeeb [IMP] mail: defaultDisplayMode can be directly assigned
Part-of: odoo/odoo#115945
2023-03-20 20:14:47 +01:00
Didier (did) 580042a2f5 [IMP] mail: Move lastInterestDateTime to a getter
Part-of: odoo/odoo#115945
2023-03-20 20:14:46 +01:00
Alexandre Kühn 70b165a1db [FIX] mail: open call settings then select mailbox should not crash
Steps to reproduce:
- open Discuss app with "General" as active thread
- open call settings in the inspector
- open a mailbox as active thread

Crash:
```
Cannot read showOnlyVideo of undefined
```

This happens because discuss has a single thread view
that is shared for any selected thread. However, the
call settings menu only makes sense for thread that
have call feature, which applies for only channels.
Mailboxes should not have any call settings menu.

closes odoo/odoo#115769

X-original-commit: 6e98ed068f01903383aca3348c193b56b46c6f95
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-20 20:14:42 +01:00
Alexandre Kühn 99fc12db92 [FIX] mail: message deletion should not crash
Was due to typo in code.
Tests should have failed due to crash, somehow it passed ci/runbot

closes odoo/odoo#115677

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-18 00:53:41 +01:00
Nemael 9e24ba9b0a [FIX] mail: messaging menu counter disappear at 0 notifications
This commit changes the behavior of the messaging menu counter
When there is 0 notifications, the counter will disappear

Part-of: odoo/odoo#115677
2023-03-18 00:53:41 +01:00
Sébastien Theys 6f0eae31ed [FIX] mail: remove flickers when (un)following
Part-of: odoo/odoo#115677
2023-03-18 00:53:41 +01:00
tsm-odoo 62b736be2d [FIX] mail: download logs
- disable when no logs available
- log file contains undefined in its name

Part-of: odoo/odoo#115677
2023-03-18 00:53:40 +01:00
Zelong Lin 9824634e7c [FIX] mail: not possible to mention
Part-of: odoo/odoo#115677
2023-03-18 00:53:40 +01:00
Alexandre Kühn df1c973db6 [FIX] mail: messaging menu header sticky
Before this commit, when scrolling in messaging menu, the header was scrollable too,
which shouldn't be the case.

closes odoo/odoo#115715

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-17 22:27:19 +01:00
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Romain Estievenart 501b442340 [IMP] web,mail: many2one avatar quick assign
Purpose:

Allow quick assignation of records in the kanban views (and other places
by extension).

Currently, if you want to work in a board-like env (e.g. tasks in
kanban, crm in pipeline, that kind of thing), having the possibility to
quickly assign/unassign records without having to open them fullscreen
can be really useful => it should be possible to "quick edit" these
fields in kanban views easily, without switching to form views.

If you want to keep the field readonly don't forget to add the readonly
attribute.

Task-id: 3121207
Part-of: odoo/odoo#114400
2023-03-10 17:54:56 +01:00
Romain Estievenart 66321f76aa [IMP] web,mail: many2many avatar quick assign
Purpose:

Allow quick assignation of records in the kanban views (and other places
by extension).
Currently, if you want to work in a board-like env (e.g. tasks in
kanban, crm in pipeline, that kind of thing), having the possibility to
quickly assign/unassign records without having to open them fullscreen
can be really useful => it should be possible to "quick edit" these
fields in kanban views easily, without switching to form views.

If you want to keep the field readonly don't forget to add the readonly
attribute.

Task-id: 3121207
Part-of: odoo/odoo#114400
2023-03-10 17:54:56 +01:00
Michael (mcm) f18e11d177 [FIX] mail: prevent displaying attachment preview in dialog
Before this commit, attachment preview could be displayed
in x2m dialogs. Now, the compiler removes the attachment preview
from the arch so it is never displayed in renderer.

closes odoo/odoo#114967

X-original-commit: 4938d27da71da1e30899bad80c9cad3cb96aa417
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-03-10 16:48:17 +01:00
Xavier BOL (xbo)andLaurent Stukkens 34ebf7f4cf [FIX] mail: use relation getter defined in parent component
Before this commit, the relation is found in the fields of the record
of the component but the relation could also be in the props of the
component.

This commit uses the getter `relation` defined in the parent component
(Many2OneAvatarField) to search the relation in the props first and
then in the fields of the record is the relation is not defined in the
props.

task-2702636

Part-of: odoo/odoo#108605
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
2023-03-09 20:52:50 +01:00
Pierre-Yves Dufays 5c5282ba15 [FIX] {test_}mail: fix send message button activation (_mail_post_access)
The attribute _mail_post_access='read' on a model allows user with read only
access on the model to post a message. It was not taken into account on the
client side, making the send message button disabled for user with readonly
access on such model. This commit fixes this issue and now correctly takes
into account that class parameter.

Task-3178885 (Mail: fix 'readonly' post support)

X-original-commit: odoo/odoo@d2b8612cf7
Part-of: odoo/odoo#114511
2023-03-07 18:03:03 +01:00
Aaron Bohy 132ee0b72b [REF] web,mail,project: remove legacy form debug items
Those items are no longer used since the legacy form views have
been deleted from the codebase.

closes odoo/odoo#114394

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-07 12:25:05 +01:00
Jorge Pinna Puissant 688986f888 [REF] web, *: simplify concrete fields API - remove value prop
This commit, is part of a series of commits that aim to simplifie the
concrete fields API.

In this commit we will remove value prop from concrete fields. Now each
field will directly use this.props.record.data[this.props.name] to
access their value, As a consequence of this, the name props need to be
mandatory.

task-id 3179751

closes odoo/odoo#113495

Related: odoo/enterprise#37464
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-07 09:02:50 +01:00
Michael (mcm) 15200a122e [IMP] mail,*: revamp activity records UI
* hr_holidays,project

This commit revamps some activity records UI in different applications.

closes odoo/odoo#111373

Task: 3133150
Related: odoo/enterprise#36473
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 18:52:47 +01:00
FrancoisGe 17a24020ac [REF] *: do not use activeFields in Field components
This commit is to replace all uses of activeFields in Field components
by passing fieldInfos to extractProps. We will therefore retrieve the
node-dependent information in the extractProps function.

Why?
This ensures that the info used is that of the correct node. Because the
activeFields function contains the information from the last node that
referred to the same field.

Example:
<tree>
    <field name="a"/>
    <field name="a" context='{'b':"yop"}'/>
</tree>

For the first field:
    FieldInfo.context = {}
    activeField.context = {'b':"yop"}

For the second field:
    FieldInfo.context =  {'b':"yop"}
    activeField.context = {'b':"yop"}

Part of task: 3179751

closes odoo/odoo#113874

Related: odoo/enterprise#37621
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 15:18:48 +01:00
FrancoisGe 263066cbef [REF] *: rename fieldsToFetch to relatedFields
We take advantage of the change of api made in commit
145540921f to rename FieldsToFetch to
relatedFields.These two commits are in the same version of odoo (16.2).

FieldsToFetch is not a good name for defining the fields to be fetch for
relational fields. So we decided to rename it to relatedFields.

Part of Task: 3179751

closes odoo/odoo#113963

Related: odoo/enterprise#37651
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 13:13:05 +01:00
Thanh Dodeur b63f407c42 [FIX] mail: log peerConnection stats during recovery attempts
closes odoo/odoo#114185

X-original-commit: 7293541edf370e26786603e0c74b10343bb8f764
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-02 17:13:42 +01:00
Alexandre Kühn 76d339a266 [FIX] mail: upload file on draft record
When uploading a file on a draft record, it crashed.
This happens because the file upload was applied on record
while still in "draft".
This fixes the issue by awaiting chatter is saved, to proceed
with the file uploading.

opw-3204555

closes odoo/odoo#114106

X-original-commit: 45bcd91026b93997e7ba2509c5c4176db269c3c6
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-02 16:01:14 +01:00
Bruno BoiandMathieu Duckerts-Antoine 8a39822aa5 [IMP] mail: add Avatar component
We introduce a new component Avatar whose role is to allow an easy
display of an image and a display name for a user (or emplyee, ...).
A click on the image opens a chat window allowing to chat with that user.

Part-of: odoo/odoo#112756
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-28 20:38:50 +01:00
Thanh Dodeur 6ed01e9412 [FIX] mail: makes sound effects more resilient to race conditions
Before this commit, there were cases were play() could be called after
stop().

opw-3178875

closes odoo/odoo#113802

X-original-commit: 4aac721eedfa220057e1e5e9f4d10c129c1b64cb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-02-27 21:30:49 +01:00
Abdelouahab (abla) 0d1a074854 [FIX] mail: uncheck recipient without partner
To reproduce
============
- on website add or edit **contact us** form to create a task on a project
- fill the form from Incognito
- on project -> the created task : try to send message on chatter
- you will find the email used when filling the form with possibilty
to check it as receiver
- check the box, a dialog will open to create a Partner for this email
- close the dialog without modifying anything

Problem
=======
the checkbox will remain checked, but when you send a message no email will be sent

Solution
========
as stated in this comment https://github.com/odoo/odoo/blob/de1f701e7bd7ebb6f7ebea5c097d980039c4f904/addons/mail/static/src/components/composer_suggested_recipient/composer_suggested_recipient.js#L128-L130
we will only send the message to partnenrs, so if no partner is
created we must uncheck the checkbox.

opw-3168779

closes odoo/odoo#113701

X-original-commit: 24e6a16e349e1521fadc8c18574c15389c550f0c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2023-02-26 21:11:08 +01:00
Aaron Bohy 9374a6f2b7 [REF] *: js fields: extractProps receives fieldInfo
This commit is part of the preliminary work to rewrite the form,
list and kanban model. We want this new Model to only be aware of
field related information it needs (whereas in its current
implementation, the model stores all the information extracted
from the field node in the arch). This would allow to properly
manage multiple occurrences of the same field in views, that is,
each occurrence would be represented by a field component (if
visible of course), and that field component would use the field
information of the arch node it represents. To this end, we want
fields from not using anymore information stored in activeFields
in the record datapoint. Instead, we now call extractProps with
the whole fieldInfo (the information extracted from the arch), s.t.
each field can generate the props it needs from those information
(e.g. sub views for x2manys).

This commit doesn't remove the use of record.activeFields in
concrete fields (this will come later), but reworks the fieldInfo
object generated by parseFieldNode, and provide it to the calls of
extractProps. In fieldInfo, the `options` key is no longer inside
`attrs`, as it is now top-level, alongside several other generic
keys that have been processed (like on_change, modifiers...). For
that reason, a lot of extractProps definitions had to be adapted.

Part of task 3179751

closes odoo/odoo#113092

Related: odoo/enterprise#37266
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-02-24 11:11:32 +01:00
FrancoisGe 94c49cfdee [REF] *: fieldDependencies to Array
As with fieldsToFetch in commit 25bf5a3fabfa9da5367e82d1c5713425c77bc373,
we will convert fieldDependencies into an array of fields.
We did it because it's easier to use and more natural to has an array.

Part of task 3179751

closes odoo/odoo#113482

Related: odoo/enterprise#37449
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-23 16:08:42 +01:00
FrancoisGe 63aaf17392 [REF] *: remove field from args pass to extractProps
This commit aims to simplify the extractProps api by removing "field".

The Field will need to go into
this.props.record.fields[this.props.fieldname] to access the information
previously stored in the "field" parameter.

Part of Task: 3179751

closes odoo/odoo#113214

Related: odoo/enterprise#37469
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-23 14:54:11 +01:00
Pierre-Yves Dufays 69011e329c [IMP] mail: avoid displaying twice the email in the composer recipients
When the contact name was not yet set, the email was displayed twice in the
composer: first as the contact name and then as the email in parentheses. Now
when the contact is the same as the email, nothing is displayed in parentheses.

Technical note: the regexp in the mail util parseEmail method has been slightly
modified because it was returning in some cases the name surrounded by quotes
(ex.: "newlead3@ex.com" <newlead3@ex.com> --> name: "newlead3@ex.com"). This is
no longer the case with this change. That change was needed for comparing the
name and the email to avoid to display the same thing twice (when the email and
the name are the same). Note that the method is only used once, where we have
done the change.

Task-3024050

Part-of: odoo/odoo#105111
2023-02-23 14:53:57 +01:00