Commit Graph
4559 Commits
Author SHA1 Message Date
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
Pierre-Yves Dufays 4991dbc9a8 [REF] mail: adapt test using new main attachment mixin
Task-2648976

Part-of: odoo/odoo#110734
2023-03-02 12:32:11 +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
Sébastien Geelen (sge) aa252adf4f [ADD] web,mail : new dynamicplaceholder tour
Add a tour that test the basics of the dynamic placeholder
dropdown functionality.

task-3081325

closes odoo/odoo#109326

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-24 16:09:45 +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
Pierre-Yves Dufays 31811ba89f [IMP] base, crm, mail: prefill partner creation form with current record data
Selecting a recipient for which there exists no partner trigger a partner form
dialog creation. For some model (ex.: crm.lead), some default values can be
prefilled from the current record. This is what we do here by calling a generic
mechanism that allows each model to define default value for related partner.

Note that we don't provide a more detailed form to the user because some will
otherwise feel obligated to fill it out entirely.

Technical note: As there is no need for a custom form per model from which the
data are extracted to populate the related partner, the simplified partner form
(view_partner_simple_form) is just augmented with additional invisible field by
modules that add fields to partner and need to populate them automatically from
values of another model.

Technical note: In TestCRMLead.test_message_recipient_partner_auto_creation, we
test that the _message_get_suggested_recipients returns the correct default
values to copy some fields from the lead to the partner to avoid the user to
reenter them. But we don't test specifically that it also work when using mail
composer and template (which generate the partner) because it has already been
tested when introducing the mechanism. Although, we verify that it should
behave the same because we verify that the default values returned by
_get_customer_information, that is used in mail template when using the
composer, are the same as the ones returned by _message_get_suggested_recipients
which is tested here.

Task-3024050

Part-of: odoo/odoo#105111
2023-02-23 14:53:56 +01:00
Aaron Bohy f87dd9ed0d [FIX] web,mail: tooltip service: correctly apply default delay
The delay of tooltips opened with the tooltip service can be given
in xml, with attribute data-tooltip-delay. If not specified, there
is a fallback in the service to 400ms. Before this commit, the
fallback wasn't correctly applied, because we parsed the xml delay
into an integer, which was NaN when the delay wasn't specified,
and as NaN isn't undefined, the fallback wasn't applied. As a
consequence, we opened the tooltip in a setTimeout with NaN as
delay, and it thus opened directly.

closes odoo/odoo#113425

X-original-commit: 553b2775a4b31c75d1d246816b749e4521e25726
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-22 21:37:33 +01:00
tsm-odoo 36aa579ed8 [FIX] mail: fix is_typing timeout after closing the channel
This PR fixes an error that occured when a typing timeout callback was called
after closing the channel.

Steps to reproduce the issue:
- Open a channel in the Discuss app.
- Type some text in the composer.
- Close the channel.
- Wait 5 seconds.
- The following traceback appears.

```
UncaughtPromiseError > TypeError
Uncaught Promise > undefined is not iterable (cannot read property Symbol(Symbol.iterator))
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at ModelField._convertX2ManyValue (http://localhost:8069/web/assets/debug/web.assets_backend.js:130149:28) (/mail/static/src/model/model_field.js:499)
    at ModelField._setRelationUnlinkX2Many (http://localhost:8069/web/assets/debug/web.assets_backend.js:130445:38) (/mail/static/src/model/model_field.js:795)
    at ModelField._setRelationUnlink (http://localhost:8069/web/assets/debug/web.assets_backend.js:130425:29) (/mail/static/src/model/model_field.js:775)
    at ModelField.parseAndExecuteCommands (http://localhost:8069/web/assets/debug/web.assets_backend.js:130086:34) (/mail/static/src/model/model_field.js:436)
    at ModelManager._update (http://localhost:8069/web/assets/debug/web.assets_backend.js:132561:24) (/mail/static/src/model/model_manager.js:1304)
    at ModelManager.update (http://localhost:8069/web/assets/debug/web.assets_backend.js:131589:26) (/mail/static/src/model/model_manager.js:332)
    at model.update (http://localhost:8069/web/assets/debug/web.assets_backend.js:133012:31) (/mail/static/src/core_models/record.js:139)
    at model.unregisterCurrentPartnerIsTyping (http://localhost:8069/web/assets/debug/web.assets_backend.js:157479:18) (/mail/static/src/models/thread.js:941)
    at model.onCurrentPartnerInactiveTypingTimeout (http://localhost:8069/web/assets/debug/web.assets_backend.js:157593:18) (/mail/static/src/models/thread.js:1055)
    at model.onTimeout (http://localhost:8069/web/assets/debug/web.assets_backend.js:160569:69) (/mail/static/src/models/timer.js:34)
```

closes odoo/odoo#113424

X-original-commit: 3a586c2a20de2a8208f7b3d55086bf86dda92577
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-02-22 21:37:30 +01:00
tsm-odoo 8fad8e6a26 [FIX] mail: new messages not showing for unknown channel types
Before this PR, messages received on channels with unknown channel
types weren't displayed on discuss. This was due to the fact that
the sidebar computed its items based on the channel type.

Steps to reproduce this issue:
- Open one browser as mitchell admin (on the Discuss app).
- Open one browser as marc demo (on the Discuss app).
- Send a message from admin to demo.
- Unpin the channel on the admin browser.
- Refresh admin browser.
- Send a message from demo to admin.
- The message is not received on the admin browser.

This PR fixes the issue by fetching channel data if the channel type
is missing when receiving a new message.

closes odoo/odoo#113377

X-original-commit: 3398aa8b10a1d9ad75552871e532f57ffcdd4a7f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-02-22 15:39:04 +01:00
Jorge Pinna Puissant aed1ba484d [REF] web, * : simplify concrete fields API - remove type prop
This commit, is part of a series of commits that aim to simplifie
the concrete fields API.

In this commit we will remove type prop from concrete fields. Now each
field could directly use this.props.record.fields[this.props.name].type
if they need to know the type of field.

task-id 3179751

closes odoo/odoo#112792

Related: odoo/enterprise#37118
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-22 13:46:29 +01:00
Jorge Pinna Puissant 8cde3e84bb [REF] web, * : simplify concrete fields API - remove update prop
This commit, is part of a series of commits that aim to simplifie
the concrete fields API.

In this commit we will remove update prop from concrete fields. Now each
field will directly use this.props.record.update to make changes, and
handle the save in fields that need to (e.g. priority). As a consequence
of this, the record props need to be mandatory.

task-id 3179751

Part-of: odoo/odoo#112792
2023-02-22 13:46:19 +01:00
Didier (did) ba2d6b9daa [FIX] mail: fix traceback when deleting a link preview
This PR fix a traceback that occur when pressing spacebar while the confirm
dialog for deleting a link preview is open.

task-3196494

closes odoo/odoo#113274

X-original-commit: d46a5171378497992bd65634f1aded53db27e9ef
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-02-21 21:07:51 +01:00
Mathieu Duckerts-Antoine 94c2db94e0 [FIX] *: adapt code related to orm service create
The previous commit has as a side effect to change the value returned by
the create method of the orm service. Here we adapt the code that uses it
and make the test pass.

Part-of: odoo/odoo#111965
2023-02-20 19:25:00 +01:00
Xavier BOL (xbo) 1c3448ba70 [FIX] mail: use the right component for kanban many2many_avatar_user
Before this commit, since the commit [1] changing the field registry,
the component used for the `kanban.many2many_avatar_user` widget is not
right one.

This commit fixes the issue by setting the right component for the
widget.

[1] 9f4622492c

closes odoo/odoo#112925

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 19:00:04 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
Aaron Bohy 145540921f [REF] web,mail: handle "color_field" option in M2MTagsField
Before this commit, there was a hack done in Field.js to handle
a special case of the Many2ManyTagsField which sometimes require
an additional "color" field to be fetched. This field is given in
option on the many2many field, in the arch.

It wasn't possible for the Many2ManyTags field to add that field
on its "FieldToFetch", because this object was static (it didn't
depend on the arch). This commit allows it to do so as FieldsToFetch
can now be a function that receives the fieldInfo (extracted from
the arch) in arguments.

So with this commit, fieldsToFetch can be either an array of fields
(instead of an object as before), or a function returning an array
of fields.

Part of task 3179751

closes odoo/odoo#112518

Related: odoo/enterprise#37020
Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-02-14 17:09:29 +01:00
FrancoisGe 45ef57bedc [REF] web: convert Record.formattedRecord to utils
To evaluate the KanbanRecord and the ActivityRecord, a formattedRecord is passed.

What is a formattedRecord:

Before this commit:
The base record + all its fields with the keys value and raw_value.
formattedRecord = {
    ...Record(),
    field1: {
        value: ...,
        raw_value: ...,
    }
}

After this commit:
All its fields with the value and raw_value keys.
formattedRecord = {
    field1: {
        value: ...,
        raw_value: ...,
    }
}

This modification avoids giving access to the functionality of the Record
class directly in the arch. The arch should never have access to the
internals of the Record.

closes odoo/odoo#112618

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-14 14:37:51 +01:00
Aaron Bohy 49297bc7bb [REM] *: remove legacy basic views + some fields/widgets
This commit removes the legacy implementation of the form, kanban
and list views. It also removes the legacy view widget registry,
and all legacy widgets it contained. The legacy field registry
couldn't be removed yet as some fields are still used (e.g. in
client actions: FieldMany2One, FieldMany2ManyTags...), and
sometimes accessed from that registry (e.g. uom service). More
clean up will come later. Note that all tests using legacy views
have thus been removed, even though the tested feature might still
remain (e.g. FieldMany2One tests have been removed, but that field
is still there). However, those features are deprecated and
unlikely to evolve. They should be removed in the next saas, or the
one after.

Finally, this commit also removes the legacy view dialogs.

Task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:58 +01:00
Adrien Minne (adrm) 329fc12c89 [FIX] mail: fix y overflow in chatter
For some font families, there was an y overflow and a scrollbar in the
chatter when inserting an @mention. This was because the font height +
the padding of `a.o_mail_redirect` was greater than the line height.

Added an `overflow-y: hidden;` in the css to fix the issue.

closes odoo/odoo#112153

X-original-commit: 3a40fa55919b5a4befc93beaf212521b61f15085
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-07 19:53:01 +01:00
Sergey Shebanin fadcc369ad [IMP] mail: define title for full composer
Before this commit title for full composer dialog window is "Odoo".
It increases probability of mistake for user because it doesn't clear
that user do: sending email or logging note.

After this commit title matches dialog purpose.

closes odoo/odoo#112111

X-original-commit: c29dc28534f03ccec2e390c44b16525ee45a6b3b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-07 16:38:39 +01:00
Alexandre Kühn 21d090bf04 [FIX] mail, im_livechat: open profile on click livechat correspondent
Before this commit, clicking on message author opens chat with
author, including in a livechat conversation.

This feature is not useful in livechat, as there's already a
way to communicate with the visitor. In earlier versions,
click on author opens profile, which is quite useful.

This commit puts back this feature of opening profile from
author click in livechat.

closes odoo/odoo#111799

X-original-commit: 2b43fb452c28554d5b3659e8531ad4de11686153
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-03 11:45:46 +01:00
Kartik Chavda c59ec25c87 [IMP] mail,project: hide label of many2many user avatar for activity
This commit hides name of user from many2many avatar user of
activity view similar as kanban view so it'll display many2many
tags properly in activity view.

task-3132890

closes odoo/odoo#109855

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-03 05:08:51 +01:00
Géry Debongnie b53f78e224 [REF] web_tour,*: use the registry in collecting the tours
This is a step closer to a goal of avoiding dependence on asynchronous
modules. Starting from this commit, new tour definition should be
registered to `registry.category("web_tour.tours")` registry.

So, instead of the following:

```js
import tour from "web_tour.tour";
tour.register(name, options, steps);
```

We now do:

```js
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add(name, optionsWithSteps);
```

Notice the `options` and `steps` params are merged when registering
the tour definition. It should look something like so:

```js
registry.category("web_tour.tours").add("account_tour", {
  test: true,
  steps: [ ... ],
});
```

And if the `TourManager` instance is needed, one can get it from the
registry like so `registry.get("tourManager")`. Note however that
this instance is only available when the `TourManager` has been
instantiated -- so it's not available at top level of the module.

closes odoo/odoo#111103

Related: odoo/enterprise#36335
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-27 23:17:35 +01:00
Thibault Delavallée 8a66cc7db0 [IMP] mail: display scheduled_datetime of delayed notify in chatter
Followup of odoo/odoo#95623 (introduce scheduled message notification) as well
as odoo/odoo#99482 (support scheduled datetime from template to composer in
both comment and mailing modes).

Task-3093257 (Mail: The Composer Update)

Part-of: odoo/odoo#107356
2023-01-27 19:56:09 +01:00
Alexandre Kühn 27fabf8da7 [FIX] mail: save record when using chatter on draft record
Before this commit, while creating a new record, the chatter
was disabled and no interaction on chatter was possible until
the record was fully created by saving it.

This was a problem because it's unclear that chatter requires
the record to be fully created. In earlier versions of Odoo,
we had to click on "Edit" and "Save" buttons of Form view, but
now that edit/read-only mode is no longer explictly managed by
the users, they'd expect to be able to interact with chatter,
even while in the process of creating a new record.

With this commit, when clicking on most actions in chatter, the
record is created. In case the record cannot be created, usual
validation errors are applied.

Task-3132931

closes odoo/odoo#110991

X-original-commit: af442bd8d42acad0cb6a49700fc9ec1934751bf1
Related: odoo/enterprise#36284
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-25 17:50:17 +01:00
Alexandre Kühn 64210e5870 [FIX] mail: no crash when uploading file on chatter with preview
This happended because when reloading the chatter, the chatter
changed position and its identity changes (i.e it's no longer
the same chatter). The old chatter was  removed, therefore it's
invalid to access relation on removed records, e.g. with
`chatter.webRecord`.

The underlying problem was that chatter should stay the same,
even with reposition. The chatter was not properly passed
between aside to bottom position.

This commit fixes the issue by properly passing chatter in
form controller.

closes odoo/odoo#110912

X-original-commit: f04bb66c0714bf732202873e2de82bcbc767a43f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-25 12:24:55 +01:00
Alexandre Kühn b410607459 [FIX] mail: scroll to attachment box when toggling it on
Before this commit, when scrolling down in chatter and then
toggling on the attachment box, it opened the attachment box
outside of visible part of scroll view.

This commit fixes the issue by automatically scroll to
attachment box when opening it.

Task-2817838

closes odoo/odoo#110640

X-original-commit: 2d835da6b734f0d9fef05c191e93757d2d2f3b1a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-01-23 11:20:23 +01:00
Romain Estievenart a10967214b [FIX] mail, test_mail: h-scroll broken on small screen
This commit add the missing `o_action_delegate_scroll` on the activity
view controller on small screen device to scroll the activity view
content only instead of the whole controller (i.e. control panel
included).

Steps to reproduce:

1. Open Project on small screen device like a smartphone
2. Open a Project like 'Office Design'
3. Switch to the Activity view and try to scroll horizontally
 => The whole activity controller currently scroll => bug

closes odoo/odoo#110531

X-original-commit: e4d6a8ad14abee72d61fd01d8b601acc6bfa2c49
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-01-20 21:56:48 +01:00
tsm-odoo c40320eb15 [IMP] bus, *: remove bus service legacy session dependency
*: calendar, im_livechat, mail.

Before this commit, the legacy session was a dependency for the bus
service. This was problematic since one would need to import a bunch
of legacy files to fulfill this dependency in order to use it.

This commit removes this dependency. In order to pass parameters to
the `bus_service`, the `bus_parameters` service is now used.

closes odoo/odoo#110247

Related: odoo/enterprise#35974
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-19 12:30:44 +01:00
Aaron Bohy d0101c104a [FIX] mail,web: keep changes when changing followers/activities
Before this commit, all pending changes in a form view were lost
when the user added/removed/edited followers or created/edited
activities. In these cases, we want to reload the record, but we
also want to keep local changes. This commit restores the behavior
of previous versions.

Task 3132939

closes odoo/odoo#110246

X-original-commit: f3697e71c2d14e66509ab04bdccf3ef656cd9c8f
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 16:19:34 +01:00
Géry Debongnie 3a5060c691 [REM] mail: remove remaining form renderer override
The mail code had to override both new and old form views to add the
chatter feature.  Since we converted (almost) all uses of the legacy
form view to the new owl views, the old override is no longer necessary.

This commit removes it, and also removes the 'legacy_form' entry in the
registry so all screens should fall back to the new form view, which is
stable.

closes odoo/odoo#110168

Related: odoo/enterprise#35924
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 13:25:43 +01:00
Aaron Bohy 942fcbfb3a [FIX] *: views: add component instance to rendering context
Owl last update fixes the leaking `this` in rendering context of
templates called with `t-call-context` [1]. Since [2], we use the
`t-call-context` directive to control the rendering context of
templates compiled from an arch (e.g. in form and kanban views).
We can now better control what people use in archs, where we don't
want them to access js implementation details, as `this` is no
longer available.

However, the component instance still needs to be accessible in
the compiled template. We thus add the `__comp__` key in the
rendering context. Since we do not want people to access it in
archs, we add a check in the view validation that this string
isn't used in dynamic attributes.

[1] https://github.com/odoo/owl/commit/df59ec49aefce2e0913fdc1792d42b9680fb28b6
[2] https://github.com/odoo/odoo/commit/4c5b867ff6b0b674cb83d1a1262ae354ebaa6d57

X-original-commit: 264f313012aa99449d1576ae1110252c13755142
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Thibault Delavallée 629ba0c392 [REF] mail: replace 'is_log' on composer by posting a note
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Remove 'is_log' field on mail composer. Indeed its usage can be globally
replaced by using the 'note' subtype when posting. It is now better matching
the result of using the log a note mode of chatter.

Posting with a False subtype_id already automatically converts it into a
note subtype in 'message_post'. It is now done directly at composer level
to lessen magic and have more control on final output.

In case of outgoing emails subtype has no usage, as notification process is
not called. It is therefore forced to False when creating the mail records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00
Thibault Delavallée 1a1acabd7b [REF] mail: cleanup mono/multi record composer behavior
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Support a real res_ids field on mail.compose.message model. Instead of relying
on active_ids from context, store it once for all at composer level and use
it in code. Active_ids usage is still done at default_get level, using it to
populate the field.

Improve usage of domain, renamed to res_domain to match other document related
fields naming. Add support of a res_domain_user_id field allowing to set the
user from which the domain should be evaluated.

Composer now runs on a list of IDs. Mass mail mode and comment mode are now
distinct from running on a singleton or on more records. Rendered or raw
mode is not triggered by

  * mass mailing mode: always display raw mode, whatever the number of records;
  * comment mode: display rendered mode when having a single record (like the
    previous comment mode). Display raw mode when having either no records
    either at least two records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:39 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
Abdelouahab (abla) 798b4f76c4 [FIX] mail: reading property from undefined
To Reproduce
============
- add event on calendar
- edit the event and remove the user from participants list and add another one.
- save the record -> traceback

Problem
=======
we try to read `hasReadAccess` from `this.followedThread` that is `null` in this case.

Solution
========
check if `this.followedThread` is `null` or not

opw-3126545

closes odoo/odoo#109721

X-original-commit: f9a23af63bb5fe882f0d42f06ef1406910836115
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-12 12:27:15 +01:00
GorashandNicolas Lempereur 772cc29218 [FIX] mail: fix create link wrong escaping of html entities
Issue: `node.data` is an unescaped text content and used as an escaped
content just after (set `innerHTML`) which remove some of the escaping.

Without the fix, the 2 new first assertions would fail:

- first one with 'https://example.com/?¤cy_id' instead of
  'https://example.com/?&amp;currency_id' in the text node

- second one with `&amp;` replaced by & and `&gt;` replaced by >

other assertions ensure that use case before the fix (special char and
URL regex, smileys, ...) still work the same after the fix.

opw-2525028

Fixes #70485

closes odoo/odoo#109357

X-original-commit: 4938af5dd8bfb4ea0722e3de8340ff6437329b48
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
2023-01-10 17:51:50 +01:00
fdardenne e602a55503 [FIX] mail: activity view: luxon in rendering context
Since the refactoring of the activity view, luxon is not in the
rendering context. Resulting in crashing in some activity views
that used luxon in their template.

- Go to Appraisal
- Switch to the activity view
- Create a record in this view -> crash

Now, luxon is in the rendering context.

closes odoo/odoo#109153

Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-01-10 10:16:51 +01:00
fdardenne ca80a60199 [IMP] mail: activity view: allow to filter columns
Before, in activity view, it was not possible for users to hide
never used columns.

Now it is possible for users to hide and show columns in the
activity view.

task-3039919

Part-of: odoo/odoo#109153
2023-01-10 10:16:51 +01:00
Renaud Thiry f039f57eb8 [IMP] Add more detailed default email subjects from chatter
All emails sent from the chatter start with "Re:" followed
by the name of the record. The name of the record alone is sometimes not enough for
the followers to understand what the mail is about.
Additionally, "Re:" does not make sense when starting a conversation.

This commit gives better default subject
for event registrations and allows thread models
to override the default subject of messages.

This also removes "Re:" from default mail subjects.

Task-2833215

closes odoo/odoo#95817

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-01-05 15:36:53 +01:00
Achraf 0c49994ea8 [FIX] mail: Escape translated emoji strings
Steps:
- Install knowledge on a fresh db
- Install and set fr_BE language
- Open knowldge
- Traceback

The traceback occurs because `emoji_registry.js` fails to load `emoji_data.js`
because of some translated string that contains non-escaped characters for JSON

opw-3110823

closes odoo/odoo#109086

X-original-commit: 455b335ae773ae4c8f5197c2a6f517947e6a7009
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-04 18:49:43 +01:00
Alexandre Kühn 2bc10b5328 [FIX] mail: load emoji data on focusing composer
Before this commit, typing an emoji source in composer like
emoticon `:)`, it may not substitute to the corresponding emoji.

This happens because the emoji substitution requires loading
emoji data. It was only loaded when opening the emoji picker.

This commit fixes the issue by lazy loading emoji data when
focusing the composer.

closes odoo/odoo#109035

X-original-commit: 066e8029c0d66974c59bfe9e430affb4bf0604b9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-04 14:45:00 +01:00