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.
closesodoo/odoo#83384
X-original-commit: 692fd6ecee602f7ceaae093b855aff65d50ca797
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#82407
Task-id: 2741837
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
closesodoo/odoo#83107
X-original-commit: 32e2d88ca0a864c91992b2c522ef21dbcb9787a5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
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.
closesodoo/odoo#82736
Related: odoo/enterprise#23609
Signed-off-by: Géry Debongnie <ged@odoo.com>
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.
closesodoo/odoo#82193
Signed-off-by: Géry Debongnie <ged@odoo.com>
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"),
});
```
closesodoo/odoo#82541
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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).
closesodoo/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>
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
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
closesodoo/odoo#79805
Related: odoo/enterprise#22267
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#82530
X-original-commit: d959638e23a92cf880049a760c42da33e5908f41
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#82418
X-original-commit: e281bd0850e935ce0d97226366114da4f5406c4d
Signed-off-by: Samuel Degueldre <sad@odoo.com>
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",
})
```
closesodoo/odoo#81814
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
closesodoo/odoo#82191
X-original-commit: 33b5e71aecc43b373ab7c863e1a1fe7a7dc8f7cb
Related: odoo/enterprise#23232
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#82132
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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
closesodoo/odoo#81893
X-original-commit: 39c678a1ccb50d3a1871a4049a8df26427b27a3c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
closesodoo/odoo#81871
X-original-commit: af566b663f42479ade2d4b4b01d052215be85c1e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
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.
closesodoo/odoo#81726
X-original-commit: 75bbec4f7fe14aa9d9c310ffcbd500bd1f70b14f
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#81199
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
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
closesodoo/odoo#81552
X-original-commit: fee371be291ba3d6f1adc71c08420b6510fdf386
Signed-off-by: Géry Debongnie <ged@odoo.com>
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.
closesodoo/odoo#80684
Related: odoo/enterprise#22722
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
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
closesodoo/odoo#80213
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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.
closesodoo/odoo#81306
X-original-commit: ea209f126c57ea2f3e456a9b459dd46fd78fc33a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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.
closesodoo/odoo#81031
Related: odoo/enterprise#22799
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
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
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.
closesodoo/odoo#81119
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#81049
X-original-commit: 2d76b33142cf2bf451d4730c035af75c3243da6f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#80866
X-original-commit: 15301a1ddaf00e51688d8134b7cb19baf386577c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#80835
X-original-commit: 5f6d72e43eaec803eea76927433706dfd5e2be73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#80822
X-original-commit: 0a2fa98086dfdaa36b01ca8ef3e22b8b8ffef60c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
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
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.
closesodoo/odoo#80450
X-original-commit: 6607244762355377ac4532302d15dac20a99f79f
Related: odoo/enterprise#22552
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
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
closesodoo/odoo#80504
X-original-commit: 88044fa003b3f17d2003bffb810965854427cbd3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
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
closesodoo/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>
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
closesodoo/odoo#79591
X-original-commit: 8def0d103020aed4211fd22f2b917567fb06de1e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Introduce the onDestroyed hook which makes a callback executable
whenever the component is destroyed.
X-original-commit: 0f454392b39dcbc7e297e882117452c5adc342be
Part-of: odoo/odoo#80353
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.
closesodoo/odoo#80346
X-original-commit: 3d27b739a3e8243d50e9764000727b31727dc2d2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
closesodoo/odoo#80338
X-original-commit: d1c9265659572c738596889f7a5ad53f673e9db4
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>