Commit Graph
2580 Commits
Author SHA1 Message Date
Aaron Bohy ca28cff17d [FIX] web,mail: fix wrong assertions in tests
This is not a big deal, but by passing a widget instance or a DOM
node as message to a QUnit.assert function, QUnit keeps a reference
to that instance or DOM element, and it can never be garbage
collected (nor its bound handlers in the case of a DOM element).

For the mail case, this was a bit more critical as we didn't check
what the author of the test actually wanted to check.

closes odoo/odoo#83384

X-original-commit: 692fd6ecee602f7ceaae093b855aff65d50ca797
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-26 08:49:09 +00:00
Philippe Wauthy a49e569bef [FIX] web: remove search_default and group_by context keys when clicking on graph
closes odoo/odoo#80463

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-01-25 09:57:10 +00:00
FrancoisGe 6daa9188cb [IMP] web: highlight searchValue in CommandItem
With this commit, when you perform a search in the command palette,
the part of the commandItem's name that matches the searchValue will
be highlighted.

closes odoo/odoo#82407

Task-id: 2741837
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-21 09:40:50 +00:00
Achraf (abz) 7c362b0b14 [FIX] web: Infinite loop with datepicker input
Steps:
 - Go into a view and filter on date/datetime
 - Select between
 - change the input max date manually
 - click outside the calendar while remaining in the filter dropdown to "validate" the input
 - infinite loop/crash

Same problem/fix as https://github.com/odoo/odoo/pull/78394 in 14.0

opw-2722797

closes odoo/odoo#83107

X-original-commit: 32e2d88ca0a864c91992b2c522ef21dbcb9787a5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-01-20 17:39:12 +00:00
Julien Mougenot db63ff2259 [REF] web: Owl imports adaptation
In the next version of Owl, all exported terms are directly available
from the top level `owl` object. This commit aims to adapt existing
imports to this new system. This is done by importing any Owl property
used in files at the top, right after the `import` or `require`
statements.

closes odoo/odoo#82736

Related: odoo/enterprise#23609
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-20 11:03:01 +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 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
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
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
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
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
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
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
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
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 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
Samuel Degueldre 431e802e31 [FIX] web: allow patching descriptors with getter/setter with value
Previously, it was impossible to patch a property that was defined with
a getter or a setter with a simple value property. This commit fixes
that.

X-original-commit: cd7514e35b458143a948c7b8e73b05760df0a482
Part-of: odoo/odoo#80543
2021-11-30 12:06:07 +00:00
Samuel Degueldre ed80461b66 [FIX] web: stop unblocking the UI on RPC response indiscriminately
Previously, when an RPC response came back, we would unblock the UI. The
goal of this was to unblock the UI that was previously blocked by a
pending RPC. The problem was that we would unblock the UI even if we
never blocked it (as we wait three seconds before blocking the UI). This
could cause the loading indicator to unblock the UI that was blocked by
unrelated code.

This commit fixes that by only unblocking the UI in the loading
indicator if the loading indicator actually blocked it previously.

X-original-commit: 654688a9d07890ff3e80f2eff07e5de87a5f1334
Part-of: odoo/odoo#80543
2021-11-30 12:06:06 +00:00
Samuel Degueldre 35ccfb712e [FIX] web: stop signaling RPC responses on the bus for silent RPCs
When an RPC request is made, we signal it on the bus. This is used,
among other things, to block the UI when the network is unresponsive.
Some RPCs however are meant to be done in the background (eg,
longpolling) and not block the UI as they take a long time by design.

When the response to an RPC arrive, we signal it on the bus so that the
UI can be unblocked. Until this commit, the silent RPCs that never
signaled making an RPC on the bus signal that their response has
arrived, which can cause the UI to be unblocked even though a
non-background RPC was made.

This commit fixes that.

X-original-commit: 695efbfdce200c05b53bc23dc838d81f24589aa3
Part-of: odoo/odoo#80543
2021-11-30 12:06:06 +00:00
Lucas Perais (lpe) 73cf808201 [FIX] web: legacy compatibility: transmit all props to the action
Make a legacy widget trigger a do_Action with `this.do_action`
in the options, pass the usual options for the doAction itself plus a props object in it.

Before this commit, the action did not receive all the props.

After this commit, it does.

closes odoo/odoo#80450

X-original-commit: 6607244762355377ac4532302d15dac20a99f79f
Related: odoo/enterprise#22552
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-11-29 14:55:28 +00:00
Fabio BarberoandMohammed Shekha 1863ebc0aa [FIX] web: avoid _reset crashing because of empty parameters
Purpose
=======
Avoid displaying a traceback when editing a partner in form view.
This was observed in crm -> Sales Teams -> Clicking on a member to save
and pressing "save" (which returned a javascript traceback in master).
The same error was also observed in mass_mailing, when editing the
responsible of a mailing list.
This was due to the ev parameter being undefined in method _reset.
A simple check has been added to see if the event is defined.

Task-2694067

closes odoo/odoo#80504

X-original-commit: 88044fa003b3f17d2003bffb810965854427cbd3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-11-29 11:22:28 +00:00
Mathieu Duckerts-AntoineandAndrea Grazioso 4aa85d304a [FIX] web: pivot: keep subTrees in comparison mode
Before this commit, when comparing a period P of reference to another one,
some rows with only data comming from P would not always be presented
in the table. The problem used to manifest only when loading at least to
level at the same time (starting from Total or any header via expand all).

The reason is the following:
- the data comming from P are processed first: starting from somewhere
  in the trees of headers, some nodes linked to the data comming from P
  are progressively created with no children at first, then the children
  (if any) are added later and so on progressively.
- the data comming from the other period is processed and nodes are
  created with no children and so on in the same way, clearing possibly
  all the node children comming from P.

For example, with
  a row groupby = [field_a, field_b],
  a group [v, v1] from P
  a group [v, v2] from the other period,
a node corresponding to v would be added, then a node child for v1.
Then the node for v would be recreated with no children, then a node child
for v2 would be created. leading to a tree of row headers of the form
Total > v > v2.

Note that it was not affecting the measure values for the displayed rows
since those measures are stored separately from the tree and are linked
to the nodes via some ids.

We fix the problem by avoiding the recreation of a node if it already
exists.

opw-2635113

closes odoo/odoo#80468

X-original-commit: 364475b5da3d4aaa87db715f0c0bbaa9dd3e05c8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Andrea Grazioso <agr@odoo.com>
2021-11-29 09:36:48 +00:00
Lucas Perais (lpe) 5df6a6efd7 [FIX] web: list_editable in FieldOne2Many: onSuccess at the right time
When changing a value for a o2m (list) within a form, the _setValue
returned a Promise that did not take into account the real rendering of
the list renderer.

The use case at hand is:
- enable product configurator
- have a product with options
- add that product in a SO
- add the option as well through the product configurator
- confirm the configurator

The configurator triggers an add_record event, with an onSuccess callback

Before this commit, the onSuccess callback was called too early, when the previous
rendering operations were not finished yet.

After this commit, the onSuccess is executed when the list renderer is really ready

opw-2580044

closes odoo/odoo#79591

X-original-commit: 8def0d103020aed4211fd22f2b917567fb06de1e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-11-25 10:51:42 +00:00
Lucas Perais (lpe) 2991b53511 [FIX] web: webclient: navbar: resize ignored when navbar is detroyed
X-original-commit: 7fbbdefc0e4951959c5000c471d50a01481392a8
Part-of: odoo/odoo#80353
2021-11-25 09:14:01 +00:00
Lucas Perais (lpe) c1c5509508 [FIX] web: core: hooks: onDestroyed
Introduce the onDestroyed hook which makes a callback executable
whenever the component is destroyed.

X-original-commit: 0f454392b39dcbc7e297e882117452c5adc342be
Part-of: odoo/odoo#80353
2021-11-25 09:14:01 +00:00
Lucas Perais (lpe) f8920c8078 [FIX] web: webclient, action_adapters: change tab title whenever a push state occurs
From a list view with multiple records, go on a record of that list
Click on the pager next button

Before this commit, the browser tab's title was not updated to the second records.

After this commit, it is.

closes odoo/odoo#80346

X-original-commit: 3d27b739a3e8243d50e9764000727b31727dc2d2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-11-25 09:13:54 +00:00
Hubert Van de Walle (huvw) fd381e99af [FIX] web: quickedit on readonly one2many list
Steps to follow

  - Go to the purchase app
  - Create a RFQ, add a line, confirm it, lock it and save it
  - Click on the one2many line
  -> An editable popup is opened and the main form is also switched in edit mode

Solution

  - Check if the one2many list has a readonly modifier before switching the main
    form to edit mode
  - When opening the one2many preview popup, pass along an editable param

opw-2689420

closes odoo/odoo#80338

X-original-commit: d1c9265659572c738596889f7a5ad53f673e9db4
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-24 16:32:57 +00:00