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
The http.addons_manifest is a map {module: manifest_dict} that is
populated upon the first http request. This map is basically a module
manifest cache with an extra `addons_path` key, the path of the module
on the file-system. This cache is eagerly populated upon the first http
request, the map is empty in non-http contextes (e.g. cron) which have
been a source of bugs (e.g. 50c8eb1).
A manifest cache is necessary because reading and parsing python files
from the file-system is not that cheap but there is no reason that cache
is located in `odoo.http`. A thin cache layer now wraps
`load_information_from_description_file()`/`load_manifest()` and is
lazily populated.
The `http.addons_manifest` have been removed. The extra `addons_path`
key is now present in the "normal" manifest. The `read_manifest()` was
hardly used so it has been deprecated. The only way to retrieve a
manifest is now `load_information_from_description_file()` which was
renamed `load_manifest()` (no cache) and `get_manifest()` (cache).
Side note about performances, the cache is necessary. Addons manifest
are read-only and reading + parsing python files from the file system is
not a cheap operation. Running the e-commerce tour
`@website_sale.test_04_admin_website_sale_tour` without cache on
`load_manifest()` requires 68,29 secs to complete on my laptop,
exceeding the default 1-minute time frame allowed in tests. Using a
cache the time is down to 36,53 secs. The performance impact is huge.
Part-of: odoo/odoo#79977
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>
Purpose
=======
Avoid counting requests from social bots (twitter, facebook, linkedin...)
when tracking a link.
Specifications
=============
Social media platforms have a specific user agent in the HTTP headers that
can be used to detect them and to not increment the click count in that case.
Task-2578902
closesodoo/odoo#78806
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
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
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>
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.
closesodoo/odoo#80842
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>
Put "Sign Now", "Send" and "Share" into the dropdown menu of "Action" button when the window is too small
Add add "Send" "Sign Now" and "Share" buttons in the list view
Make green saving Kanban in the center of the screen when the window is too small
Change the order of buttons for signature popover
Make "width: 30%" css only for buttons for signature popover to avoid text overflow
change 'Adopt and Sign' to 'Adopt & Sign'
before this commit: there are some overflow and misalignment for buttons
task-2630720
closesodoo/odoo#79292
Related: odoo/enterprise#21671
Signed-off-by: Arnaud Joset <arj@odoo.com>
Before this fix, 'currentApp' returned 'undefined' on mobile but
there is no reason not to return the current app on mobile.
This has been fixed in enterprise repository.
Now that 'currentApp' returns a value, we have to explicitly hide
'menuItem' for small screen.
Steps to reproduce:
* Open Odoo on tablet
* Select an App => BUG
opw-2687424
opw-2688832
closesodoo/odoo#80639
X-original-commit: 3659d65f37d08737f99d62ecb8cd486ba8d764f4
Related: odoo/enterprise#22620
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
The browser object is meant to allow easily patching some native browser
behaviour when writing tests. Outside of test code, it should behave
like the corresponding properties on the window object.
Previously, the location property of the browser object held a reference
to the native window location property. While this works perfectly fine
for reading or writing things on the location object, a common use case
is to overwrite window.location with a string to navigate to a url. This
use case was not covered by browser.location
This commit fixes that by replacing the browser.location property with a
getter/setter pair, where setting a value on browser.location will do
the same thing on window.location
closesodoo/odoo#80543
X-original-commit: e838c76b1656dc289ff35e89283b8cc82e636df7
Related: odoo/enterprise#22590
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Samuel Degueldre <sad@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
In order to add subtitle to settings subsections,
this commit adds style to h3 in settings style sheet.
Task-2516278
COM PR: odoo/odoo#76934
ENT PR: odoo/enterprise#21055
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
=======
If the user doesn't have access to ir.ui.view (aka no admin or
website access rights), printing a report with a configured
external layout will lead to a traceback, as it's forbidden
for the use to read on the field "key" on the related ir.ui.view.
As we only want to retrieve the view key, this is safe to use
sudo at that point.
closesodoo/odoo#80528
Taskid: 2701251
X-original-commit: 3891ab34740a86a5e795b9fbcb3fb998d705985e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, words are not breaking properly when reaching at the
end of a line in the pie chart tooltip. It happens because of the
'word-break: break-all;' property used in the o_tooltip_legend class.
and this property breaks the words at any character to prevent overflows.
So this commit fixes the issue by removing the word-break property
so that the CSS automatically applies the default line break rules.
TaskID-2677129
closesodoo/odoo#80512
X-original-commit: 5dfd66f03e914fad58deeb45fcc31210293ae162
Signed-off-by: Lucas Perais (lpe) <lpe@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>
Issue:
The way we generate the dayNamesMin is not compatible with the chineese
translation provided by "moment.js".
This is because the dayNamesShort contains an extra character in front
週 (week). Because of that the names of the days on the
small calendar are all the character 週 (week).
Solution:
There is a variable (weekdaysMin) which is unused and contain a shorter
version of the days this variable is consitent in the other languages so
it should have no side effect and will fix the chinese translation as it
only contains one character.
Introduced by: 1fc33a63be
task-2692910
closesodoo/odoo#80448
X-original-commit: 7cc502a6eb61bc541dbc27beefed004fcf81e04b
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: fja-odoo <fja@odoo.com>
After this commit, all users will be able to access the Debug Command.
closesodoo/odoo#80122
X-original-commit: faf208d939ea3a97ae85a31274b061c91e4cef7b
Signed-off-by: Géry Debongnie (ged) <ged@openerp.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>
The use case happens in studio.
have some overflowing app submenus in an app
go into studio
refresh with a simple F5.
Before this commit, the navbar's overflowing buttons wouldn't put themselves inside the "more" dropdown
This was because the studio client action also reacts to change in the menu service, so the technical flow was:
- laodState (webClient)
- setMenu (MENU-CHANGED on the bus), then because of it:
- studio client action > render (1)
- studio navbar > render (with adapt right after that render!) (2)
- studio navbar > render (because of 1) which cancels the render in 2 without cancelling the promise, that is
adapt is still called.
To remedy this, the standard use of useEffect and useBus are is put into place.
After this commit, the studio navbar has its overflowing menu items in the dropdown.
The adapt algorithm now uses getBoundingClientRect to get the not rounded width of elements that should be adapted,
otherwise, slight differences in browser's computation and rounding of offsetWidth may influence test results.
closesodoo/odoo#80353
X-original-commit: 231902738287a897f50a1711f991bc55928b77d9
Related: odoo/enterprise#22498
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
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>
Before this commit, the opening of a calendar popover could crash
because we tried to evaluate the domain of the readonly modifier.
Only the invisible modifier is necessary in the calendar popover so
this commit fixes the issue by evaluating only the invisible modifier.
It was also evaluated twice to do both the same thing so this commit
remove the duplicated lines.
closesodoo/odoo#80318
X-original-commit: c558ae309ff63a26c30ea0196930eb15a279e1dc
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Since https://github.com/odoo/odoo/pull/79858,
we define the patch._super with an `Object.defineProperty`.
It works well but it prevents objects from being patched
by the legacy patch method afterwards.
closesodoo/odoo#80317
X-original-commit: 2090e09c51876b9b8af4097ca8f093a8c19361e0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
In this commit I provide a way for any part of the webclient to load a complete bundle of assets, JS and CSS.
The primary goal is to lazy load the complete o_spreadsheet package, including the library and all the custo that odoo includes
in it.
the endpoint /web/bundle/bundle_name will return a json structure describing the path to the JS and CSS files that have been generated by the client.
Those can then be loaded with the loadJS(...) function like any library.
The advantage of using a bundle, is that all the dependencies are respected inside that bundle.
closesodoo/odoo#76361
Task-id: 2576814
Related: odoo/enterprise#21804
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Before this commit, going to a form view using the breadcrumb menu did
not retrieve the record id. The record id was not present in the url.
So, if you reloaded the page, the record was not displayed anymore.
closesodoo/odoo#80174
X-original-commit: 3eeaa6b1c6f54be9a87e67140ab57fe8f3a61407
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit
Calling the rainbow_man effect with a custom component would replace entirely the RainbowMan component instead of passing it a subcomponent to display.
After this commit
It is fixed.
closesodoo/odoo#79962
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>