Commit Graph
12453 Commits
Author SHA1 Message Date
Leonardo Pavan Rocha 022d34e1e5 [IMP] calendar: improves colors and design
In calendar events, the displayed colors are a bit dark and meeting
names in black don't have enough contrast. This commit fixes this
issue and improves general design of the calendar module.

task-2704288

closes odoo/odoo#81184

Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-01-20 08:21:50 +00:00
Leonardo Pavan Rocha 14b009c071 [REF] calendar: fix typo in o_event_highlight class
Fixes a typo in the calendar css class 'o_event_hightlight' to
'o_event_highlight'.

task-2704288

Part-of: odoo/odoo#81184
2022-01-20 08:21:50 +00:00
FrancoisGe 91394ed79d [FIX] web: Command Palette FooterComponent
This commit solves a naming error introduced by commit 1e1b45ea62, the name of a component always starts with a capital letter.

closes odoo/odoo#82629

Related: odoo/enterprise#23285
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-19 16:52:18 +00:00
Samuel Degueldre f108b21e6b [REF] web: stop using component ref in navbar
This is in preparation for owl2

closes odoo/odoo#82326

Related: odoo/enterprise#23289
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-18 13:40:30 +00:00
Samuel Degueldre 53b7d2a632 [REF] web: stop using component ref in dialog tests
This is in preparation for owl2

Part-of: odoo/odoo#82326
2022-01-18 13:40:30 +00:00
Samuel Degueldre 8b38281b84 [REF] web: stop using component ref in popover tests
This is in preparation for owl2

Part-of: odoo/odoo#82326
2022-01-18 13:40:29 +00:00
Samuel Degueldre b773f9e492 [REF] web: stop using component ref in createControlPanel
This is in preparation for owl2

Part-of: odoo/odoo#82326
2022-01-18 13:40:29 +00:00
David Monjoie 2a0298434f [REV] web: revert ensure scrollbar in mail designer
This reverts commit 247adbb3aa79223c18083caf31e6580905ce32e8 as it broke
the website design. We do not know yet what the reason is and we'll need
to investigate further. Probably a css specifity issue, but since this
is 15.0 stable, we chose to first revert the commit asap and re-do the
fix in another way later.

closes odoo/odoo#82823

X-original-commit: 3c8409d946e549a3d3f104b9417257b5dc7cf0c8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 19:15:20 +00:00
Antoine Guenet 449f8f3220 [FIX] web: ensure scrollbar in mail designer
Commit [1] moved the scrollbar from the document body to the top
element (#wrapwrap). This works for website builder but fails for
iframes which don't have that element. This is apparent in Marketing
Automation mail templates where it's become impossible to scroll down.
This fixes that issue by excluding iframes in that rule.

task-2734825

[1] https://github.com/odoo/odoo/commit/9f048625e11dacda9fd49694e89ae65bc112374f

closes odoo/odoo#82777

X-original-commit: 95f280c4032a7358deeedae1cb6f63beab70387b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 14:50:00 +00:00
Aaron Bohy 17b8539971 [IMP] web: replace unnecessary t-raw by t-esc
closes odoo/odoo#82755

Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-01-14 11:15:21 +00:00
luvi da8ff3d087 [IMP] web: t-ref instead of this.el in the CommandPalette
The commit adapts the CommandPalette to use a t-ref to a node
in the template instead of a this.el.querySelector("...") in
the component to query an element. This will improve the
compatibility with Owl 2.

closes odoo/odoo#82752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-14 11:15:18 +00:00
luvi 741b79cfcc [IMP] web: trim keywords in the search bar
When the search field is used to query an element, the value is
trimmed to remove unnecessary spaces before and after the actual
keywords. This eliminates the annoyance of a search having no
result because of a space that was left (for example when copy-
pasting some text). A test has been added to check if a value
has been trimmed when the text input contains spaces.

closes odoo/odoo#82193

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-14 07:47:08 +00:00
Bruno Boi 5bfcf170e5 [FIX] web: clear unused option from hotkey service
When adding an hotkey callback through the service's API, the `activeElement` option had no effect at all and in fact was relics of the hotkey service's development process.

It has been removed as it was broken anyway and not tested.

closes odoo/odoo#82625

X-original-commit: 0e3663f28fd012d0fced14759f9f38592014c076
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-12 14:03:37 +00:00
FrancoisGe 1e1b45ea62 [IMP] web: Command Palette footer
This commit will change the setting of the emptyMessage and the
footer of the main command palette.
In order to make the command palette footer more customizable, we will
replace it with a Component. For example, using a footerComponent in the
main command palette allows us to adapt its text based on the namespaces
used.

Setting up an empty message:
Before:
```
registry.category("command_empty_list")
        .add("@", _lt("No user found"));
```
After:
```
registry.category("command_setup")
        .add("@", {
            emptyMessage: _lt("No user found"),
            });
```

With this commit, it is possible to add a namespace to the footer tips:
```
registry.category("command_setup")
        .add("@", {
                name: _lt("channels"),
            });
```

closes odoo/odoo#82541

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-12 11:19:00 +00:00
Mathieu Duckerts-Antoine 1f85f7403d [FIX] web: graph: line chart color
Before this commit, in a line chart in comparison mode with one groupby,
if only data comming from the comparison period were displayed, the line
(with red border) would be filled incorrectly with a blue color while it
was not supposed to be filled at all (the blue filling is supposed to be
reserved to data comming from the reference period).

closes odoo/odoo#82577

Forward-port-of: https://github.com/odoo/odoo/commit/6747d982a56af0525cf52732c43351081831d32f
X-original-commit: 519e205a4b34fdecfe6b938ff4a6e93a02c2bda2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-11 16:19:00 +00:00
Mathieu Duckerts-Antoine 8c13c9cbf8 [FIX] web: graph: relabelling of fake data
In the graph view in line mode, fake data are added when there is few
data to center the graph (the points in facts). Now, there
are two problems with the relabelling of the labels created along with the
fake data:
    - the relabelling (when it works) gives "Total" instead of "" (nothing)
    - the relabelling crashes when the line chart is grouped by a date
      field, a comparison is done on that field and no data is received.

We fix the problem by introducing a custom label similar to NO_DATA
(a custom label used to manipulate fake data in the pie charts).

Forward-port-of: https://github.com/odoo/odoo/commit/a30669d1ff258e3ac71dff4d78ca295aa1be2ec8
X-original-commit: 6374618e4d201a53182c6adf2127b0e64b4e48d1
Part-of: odoo/odoo#82577
2022-01-11 16:18:59 +00:00
Krina Oza ff2ffb9e0d [IMP] web,sale_(project): improve keyboard navigation
The purpose of this commit is, to add keyboard shortcut
to multiple actions.

So in this commit, added keyboard shortcut to several actions
in project, sale_project, web_calendar and added smart action
in command palette on statusbar.

task-2655790

closes odoo/odoo#79805

Related: odoo/enterprise#22267
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-11 12:14:43 +00:00
Aurélien (avd) 2c911fe176 [FIX] web: speedup basic_model._updateRecordsData
Speedup basic_model._updateRecordsData for
many2many fields such as fetchmail.server.message_ids
and mail_channel.channel_message_ids.

Calling _.findWhere(values) inside two nested _.each
calls can be quite slow when the number of values
is big.

Remove the call to _.findWhere by first
creating a Map res_id -> data and then calling
Map.get to retrieve the data for a given res_id
when making a DataPoint

opw-2701170

closes odoo/odoo#82540

X-original-commit: aaf653e744c846d4c399498ea38e358ddee80d4a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-11 11:21:11 +00:00
Samuel Degueldre 2192480ed1 [FIX] web: pass user-context in legacy RPC
Previously, RPCs would always receive the user-context as an extra
keyword argument if they had any keyword arguments themselves. When
creating the translation layer between the old API and the new RPC
service, this was overlooked, resulting in all legacy RPCs losing their
user-context unless the user context was explicitly passed. This commit
fixes that.

closes odoo/odoo#82530

X-original-commit: d959638e23a92cf880049a760c42da33e5908f41
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-11 11:21:07 +00:00
Mathieu Duckerts-Antoine b241f7e506 [FIX] web: visual separation of search items
Since the refactoring of the views aeb8e49972f871b0c9b07c507987ee77cf5e8abbd,
the filters and date filters, the groupbys and date groupbys are now
always separated visually even if no separator/group tag has been
set in the search arch. We restablish the previous behavior that only
seperates them when a separator/group is set.

closes odoo/odoo#82418

X-original-commit: e281bd0850e935ce0d97226366114da4f5406c4d
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-01-10 13:52:45 +00:00
FrancoisGe 52a1d997d2 [IMP] web: custom command palette
This commit adds the possibility to open the custom main command palette.
So it is possible to replace some parts of the default command palette
config.

For example, we will customize the placeholder:
```
    this.command_service.openMainPalette({
        placeholder: "My custom placeholder",
    })
```

This commit also modify the api of CommandPaletteConfig, we replace
namespace by searchValue. Now it is possible to open a command palette
with a value in its input.

For example:
```
    this.command_service.openPalette({
        searchValue: "@test",
    })
```

closes odoo/odoo#81814

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-10 13:52:34 +00:00
Achraf (abz) 6c70448de0 [FIX] web: Add word-break to kanban_content
When we create a record with a very long continuous title (without spaces) the string comes out of the kanban block.
Reproducible on several applications such as Notes, CRM, etc.

opw-2680915

closes odoo/odoo#82348

X-original-commit: efe1312535b3af20c81cfd6cb10cbf3e7e5f8f90
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-01-07 09:51:16 +00:00
Priyanka Kakadiya cefd6ade29 [FIX] web: click on time should work in kanban view
Before this commit:
kanban click on time value does not open the form view.

After this commit:
kanban click on time value will open the form view.

Task-2655411

closes odoo/odoo#82191

X-original-commit: 33b5e71aecc43b373ab7c863e1a1fe7a7dc8f7cb
Related: odoo/enterprise#23232
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-04 07:59:38 +00:00
qsm-odoo 3490b998ee [FIX] web, *: fix the grab cursor not working on all browsers
*: web_editor, point_of_sale, pos_restaurant

The grab cursor is currently not working on all browsers (at least
Chrome Linux). The fallback rule does not even work, meaning that if
you type:

```
cursor: move;
cursor: grab;
```

Those browsers does not even use "move" as they see "grab" as valid but
use the "default" cursor.

This commit replaces our "grab" uses with a local cursor ensuring it
works.

Related to task-2431469

closes odoo/odoo#82093

X-original-commit: 23ebcca902781f2fa0f2381997be4f3d375385b5
Related: odoo/enterprise#23193
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-03 18:58:41 +00:00
Michael (mcm) f68bbb9b73 [FIX] web: fix calendar test
This commit fixes the calendar test "select events and discard create"
which was crashing certainly because the event we want to click on was
out of the screen at this moment.
Calendar tests use positional mouse[down|up] events to simulate clicks
on events so we need first to scroll to the wanted event before clicking
on it.

closes odoo/odoo#82132

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-01-03 10:52:49 +00:00
Martin Trigaux 5169fc0c20 [FIX] web: add record id when uploading
Before that, uploading a file from a kanban was adding res_id=0
Was missing from 5e81850ea6

closes odoo/odoo#82101

X-original-commit: 6b4b68a2682a233ca058f3b89ea0aa096061c0eb
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-30 20:46:52 +00:00
Laurent Stukkens (LTU) 9ffb0143d0 [FIX] web: order company by their sequence in the company switcher
As JS is not taking the properties in the order they are written,
the order in the rendering was always following the property name
sorting order (=id).

Previous to this commit:

    - The companies were ordered by their id in the company switcher as
      JS is not tacking the object properties order into account.

After this commit:

    - The companies will be sorted by their sequence prior to be used in the
      rendering.

task-2722235

closes odoo/odoo#81893

X-original-commit: 39c678a1ccb50d3a1871a4049a8df26427b27a3c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-12-24 12:25:01 +00:00
Yolann Sabaux 49e6abe0b7 [FIX] web: no trigger of an onchange
Steps to reproduce:
- Install Argentinian Electronic Payment (l10n_ar_edi)
- Change company (ar responsable)
- Go in Accounting > Settings: in the AFIP section
- delete key and certificate
- click on `generate request`
-> the key is not persisted unless a manual refresh/discard is done

Solution:
In V14 the `onchange` is triggered. Why?
Because this https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L130-L139
works because of the call of the `on_close` function:
https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L534-L543

Why not in V15?
In V15 the onchange can be triggered when the `this.reload` function is called via the `on_closed` function:
https://github.com/odoo/odoo/blob/7ce6d8d70be79c9c626865598b898dce9a18b045/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L472-L482

But to be triggered, in the `wrapSuccessOrFail` (when the `_trigger_up` funciton is called), the `onClose` must be called:
https://github.com/odoo/odoo/blob/fb3878b581b831c13550d40e38a8e8890d82ea0d/addons/web/static/src/legacy/action_adapters.js#L362-L376

In order to do that, we would have to use the `options` (the `params`) sent with the `doActionButton` in the `doAction` function.
https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L1198-L1199

BUT the `options` are not used anymore when `_executeActURLAction`* is called (only the `action`paramater is required):
https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L1098-L1104

Therefore, we find ourselves in a situation in which we cannot call the `on_closed` function in (the `options` are not even an 'option'**):
https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L748-L764

Look again in V14 how the function is called:
https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L527-L543

The solution is therefore easily understandable.

*we are in this specific switch_case because the action executed is
https://github.com/odoo/enterprise/blob/6805d2f591237ad17d7db827dcf6fe36c2c2744f/l10n_ar_edi/models/res_config_settings.py#L32
** no pun intended

OPW-2680841

closes odoo/odoo#81881

X-original-commit: cb9dfe107d073aeaf4a6b72818b4c28b11dab0c7
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-12-24 10:42:44 +00:00
luvi ff4ac9075b [FIX] web: Missing trash icon from custom filters
This commit fixes an issue where the trash icon was not properly
shown in the dropdown when adding more custom filters.
A test has been written to verify if the download button is
present in the dropdown.

task-2716032

closes odoo/odoo#81871

X-original-commit: af566b663f42479ade2d4b4b01d052215be85c1e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2021-12-24 08:36:43 +00:00
nurefexc eb6810d1b5 [FIX] web: missing context during resequence
Problem 1: The context was not passed when calling the resequence function.
Problem 2: Also, the subsequent read operation did not pass the full
context, but only the context of the user, not the context of the action.
A test has been added for the basic model to check that the context is properly
given after a resequence.

closes odoo/odoo#81726

X-original-commit: 75bbec4f7fe14aa9d9c310ffcbd500bd1f70b14f
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-21 12:55:01 +00:00
Samuel Degueldre 0091259e17 [REF] web: remove datetime-changed event in preparation for owl-2
In owl-2, t-on will no longer be supported on components. This commit
converts the code that used to rely on the datetime-changed event to use
a callback-prop based approach instead.

closes odoo/odoo#81199

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-12-20 20:57:13 +00:00
Aaron Bohy 0376a259e5 [FIX] web: ActionService: send user context to /web/action/run
Since commit [1], the user context wasn't put in the context
sent when executing a server action (only the context of the
action sent). This commit fixes the issue.

[1] 7354d1686915ec21437fc677f15a6c5409106492

closes odoo/odoo#81552

X-original-commit: fee371be291ba3d6f1adc71c08420b6510fdf386
Signed-off-by: Géry Debongnie <ged@odoo.com>
2021-12-16 19:12:37 +00:00
Samuel Degueldre 57a02f0a14 [REF] web: remove dropdown-item-selected event
In owl 2, the t-on directive is no longer supported on components. The
way to handle events on components is to give them a callback as a prop.
This already works in owl 1, so this commit prepares the code for an
easier migration in the future by removing the "dropdown-item-selected"
event and converting the code that was using it to use the new paradigm.

closes odoo/odoo#80684

Related: odoo/enterprise#22722
Signed-off-by: Géry Debongnie <ged@odoo.com>
2021-12-14 12:40:19 +00:00
Samuel Degueldre 671ed63b2a [IMP] web: call methods with correct 'this' in arrow function
Currently, bare method calls in arrow functions in templates are bound
to the rendering context/scope. While this gives you access to most of
the things that exist on the component for reading, writing on 'this'
will not always work, and the rendering context can pollute the
component's name space. This commit fixes that by explicitly calling the
method on the instance of the components.

Part-of: odoo/odoo#80684
2021-12-14 12:40:19 +00:00
Mitul Shah c7fd509f9c [IMP] web: improve tooltip for priority widget's star icons
Prior to this commit, when we hover on any star icon (from a priority
widget field), we only get the label of a selection value linked with
particular icon. For example, if a 'Priority field is having a selection
values 'Low' and 'High', on hover of the start, we see 'Low' and 'High'
(in the same sequence as selection values).

But sometimes (for example in kanban view, where we don't display the
field label), it is not very clear what they indicate.

This commit improves the behavior by adding a field label also in the
title attribute of the star icons so that users can get a better
understanding of what each selection means. In our example, it will
now display the tooltip as 'Priority: Low' and 'Priority: High'.

Task-2691338

closes odoo/odoo#80213

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-14 09:11:19 +00:00
Mathieu Duckerts-Antoine ace9f6c2da [FIX] web: action group_by of type string
Before this commit, an action group_by like "subscription_id" was accepted
in production mode but would make crash a view that uses the WithSearch
component as soon as the dev mode is activated. Here we fix the
problem by making the acion service process the action group_by in order
to make it pass the validation.

closes odoo/odoo#81306

X-original-commit: ea209f126c57ea2f3e456a9b459dd46fd78fc33a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-13 13:17:58 +00:00
Mathieu Duckerts-Antoine c862c8097b [FIX] web: search view after url loaded
Load an action with a list view with at least one record and open the
view form for a record. Then reload the page and go back in the breadcrumbs.
In desktop mode, one arrives at a list view again.

Before this commit, the search view was not correctly initialized.
The problem was that the list view reuse a globaState prepared by the
form view that contains a search model state that do not reflect the
search view arch (the form view does not use the search view).

We fix that problem by preventing the form view to install the
ControlPanelModelExtension. In that way, the form view does not export
a search model state in the globalState and the list view correctly
process the search view arch.

Task ID: 2697084

X-original-commit: 40e04695ef0de96df8b850fac3f7d165585d466a
Part-of: odoo/odoo#81306
2021-12-13 13:17:58 +00:00
FrancoisGe a8222d65e6 [IMP] web: add tooltip on Dropdown
This commit adds the possibility to add a tooltip on a Dropdown.

closes odoo/odoo#81205

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-13 13:17:50 +00:00
Aaron Bohy f3e71d01ee [REF] web: rework env.config
The motivation of this commit comes from breadcrumbs.

Breadcrumbs work as follows: for each controller in the stack of
the ActionService, there is an entry in the breadcrumbs. Except
for the last entry (which corresponds to the currently displayed
controller), the value to display is computed by the ActionService
and stored in this.env.config.breadcrumbs. For the last entry,
we use the displayName set in this.env.config.

When a view wants to update its displayName (e.g. the form view
when we switch to another record), it updates the displayName in
the config, which thus correctly updates the breadcrumbs. However,
this doesn't change the internal values in the ActionService, so if
another controller is stacked over the current one, the penultimate
entry is wrong. To update the internal state of the ActionService,
the event 'controller-title-updated' must be triggered as well,
which is cumbersome. Note that we don't really face the issue yet
because among already converted views, none of them need to update
its displayName in the breadcrumbs.

This commit aims at uniformizing the way the (n-1) first entries
and the last one behave, by making the "breadcrumbs" key encode
all breadcrumbs entries (the n-1 first ones, and the last, current
one). We also replace the "displayName" key by "getDisplayName"
such that it uses a single source of truth, located in the
ActionService, and we provide a function "setDisplayName" to update
it. Finally, this commit introduces the notion of "default config"
which ensures that standalone views, or views in tests, have a
valid config with expected keys.

closes odoo/odoo#81031

Related: odoo/enterprise#22799
Signed-off-by: Géry Debongnie <ged@odoo.com>
2021-12-13 12:24:50 +00:00
Aaron Bohy 2cdd30d61a [FIX] web: breadcrumbs of stacked, legacy client actions
Let's suppose a legacy client action that can be opened from
another action, s.t. it is stacked on it. Before this commit,
the breadcrumbs was incorrect in that client action, as it only
displayed the part of the client action itself, but not the
history. This commit fixes the issue.

Part-of: odoo/odoo#81031
2021-12-13 12:24:49 +00:00
Aaron Bohy 3fa70eed13 [FIX] web: correctly set window title in wowl views
The name of the action is supposed to be displayed in the second
part of the window title (e.g. "Odoo - Partners"). Before this
commit, this wasn't the case for views that were converted to
wowl (only legacy views correctly updated the window title).

Part-of: odoo/odoo#81031
2021-12-13 12:24:49 +00:00
Benjamin Vray ea650d80b8 [FIX] web: fix scrollbar width compensation when a modal is open
Before this commit, when we calculated the width of the scrollbar
to compensate when a modal is open. We did not take into account the
wrapwrap borders applied with some headers. (e.g. the sidebar header)

task-2677132

X-original-commit: 990d0f6a53047db4238c7d6a15be12e58ed1fe86
Part-of: odoo/odoo#81151
2021-12-09 18:40:45 +00:00
FrancoisGe 930a36a56b [REF] web: remove noFields in makeView
The purpose of this commit is to simplify the makeView api by removing
the noFields option.

Only two tests used it:
For the test "'resModel' must be passed as prop", the noFields option
was useless. So we can remove it.

For the test "'arch' cannot be passed as prop alone", it is not
necessary to use makeView. So we will replace it.

closes odoo/odoo#81119

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-09 12:04:59 +00:00
Aaron Bohy c171ebb054 [FIX] web: send correct filter's context when saving filter
Before this commit, the context coming from the action was
merged with the context of the search items to generate the
context of the filter to save, when the user clicked on "Save
current search", whereas it should not.

There is an ActionService test attesting it, but it currently
uses a ListView, which is still legacy, so the new faulty code
wasn't tested.

closes odoo/odoo#81049

X-original-commit: 2d76b33142cf2bf451d4730c035af75c3243da6f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-08 12:52:29 +00:00
Samuel Degueldre bfa7d28a8e [IMP] web: update owl to 1.4.10
Release notes: https://github.com/odoo/owl/releases/tag/v1.4.10

closes odoo/odoo#81048

X-original-commit: 462a58b9938f7601e9696c02d5fd4ded7c75cae0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2021-12-08 12:52:25 +00:00
Aaron Bohy 0133f4c183 [FIX] web: FieldDomain in debug: domains with dynamic content
In debug mode, the FieldDomain displays a textarea to allow the
manual edition of complex domains. However, when those domains
contain dynamic content (e.g. datetime stuff), the evaluated
version of that content was displayed, which isn't what we want.
We want to see the raw version of the domain as written in db,
and be able to edit it. This commit fixes that issue. Moreover,
we also ensure to keep whitespaces and new lines, which can be
useful for large domains.

closes odoo/odoo#80866

X-original-commit: 15301a1ddaf00e51688d8134b7cb19baf386577c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-06 07:35:42 +00:00
FrancoisGe dc93dbefe0 [IMP] web: Run JS tests
After this commit, the tests launched from the debug tools or the
command palette will be in debug=assets mode.

This commit adds the "Run JS tests" and "Run Mobile JS tests" commands.

closes odoo/odoo#80842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-03 14:19:02 +00:00
FrancoisGe 5801ff87cf [FIX] web: MockServer search
The mockSearch function should not return the list of records for a
domain and a model but the list of ids.

The path "/web/dataset/search" does not exist.

closes odoo/odoo#80835

X-original-commit: 5f6d72e43eaec803eea76927433706dfd5e2be73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-03 12:05:59 +00:00
Samuel Degueldre 7b3b421c4d [FIX] web: rerender MainComponentsContainer on main component error
Previously, when a main component errored during rendering, we would
remove it from the list of main components that should be rendered by
the MainComponentsContainer to avoid it erroring again on a subsequent
rendering (which can cause infinite error loops).

Unfortunately, since we did not rerender the MainComponentsContainer
after this removal, the erroring main component would remain, and could
cause such error loops anyway. This commit fixes that.

closes odoo/odoo#80822

X-original-commit: 0a2fa98086dfdaa36b01ca8ef3e22b8b8ffef60c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-03 09:44:04 +00:00
Adrien Widart 896e40fa62 [FIX] web: report action: define trusted_host thanks to current URL
To reproduce the issue:
(Need stock. Use demo data)
1. Login as admin
2. Go again on the DB, but using another URL
3. Login as demo
4. Consult the Forecasted Report of [FURN_7800] Desk Combination
5. Try to open "WH/OUT/00009"

Error: Nothing happens although the page should be redirected to the
order. In the browser console, an error message is displayed: "Failed to
execute 'postMessage' on 'DOMWindow': The target origin provided
('http://localhost:8069') does not match the recipient window's origin
('http://yourcompany.com:8069')."

When logging in as admin, the config parameter `web.base.url` is defined
with the URL used (URL01):
https://github.com/odoo/odoo/blob/4736344a57e176ed38f4b22cd100b3957d122818/odoo/addons/base/models/res_users.py#L717-L724

Then, when logging in as demo with another URL (URL02), since he's not
an administrator, the config parameter is not overwritten.
So, when clicking on the delivery order (step 5), an action is executed:
https://github.com/odoo/odoo/blob/b492bde6a121be1c15ed90ce0827fcfd72a12f5c/addons/web/static/src/js/report/report.js#L37-L41
where `trusted_origin` is based on `web.base.url`:
https://github.com/odoo/odoo/blob/2dbe39aed5361341cdc87607e671ef19234e0196/odoo/addons/base/models/ir_actions_report.py#L580
This explains why `trusted_origin` is URL01 and thus why the error is
raised.

Also, suppose `trusted_origin` has a correct value (URL02), there is
another issue: when the client action receives the message, a condition
will ensure that the message origin and the origin of the action are the
same:
https://github.com/odoo/odoo/blob/d3854dbf7a6e0c0f9ac00c11716908bc175808d7/addons/web/static/src/js/report/client_action.js#L73-L76
Here, `this.trusted_origin` is also URL01 because of
https://github.com/odoo/odoo/blob/62f2a62b7265645dee91c276c5171b402c0a44fa/addons/web/models/ir_http.py#L48
So this variable definition needs to be updated too.

OPW-2615024

closes odoo/odoo#80777

X-original-commit: f8ac33bcbc472d55917a1597afdd444f815d4778
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-12-02 16:04:02 +00:00