Commit Graph
14806 Commits
Author SHA1 Message Date
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
Julien Castiaux 2e29a93503 [REF] core: remove http.addons_manifest
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
2021-12-14 12:39:54 +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
Fabio Barbero a66cdf3f7f [IMP] link_tracker, http_routing: ignore requests from social bots for link tracker
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

closes odoo/odoo#78806

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-14 09:11:15 +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
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +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
Alexandre Kühn 30d7766eea [IMP] mail,snailmail,web: remove t-on on component
Preparation work to use OWL v2 in discuss code.

Task-2694200

closes odoo/odoo#80024

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-01 14:07:57 +00:00
Chong Wang (cwg) 1ceccf68e8 [IMP] sign: improve ui for buttons
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

closes odoo/odoo#79292

Related: odoo/enterprise#21671
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-01 10:17:57 +00:00
Romeo Fragomeli ef70369eaa [FIX] web: navbar menu not shown on tablet
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

closes odoo/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>
2021-11-30 17:40:11 +00:00
Samuel Degueldre 7d10f4b9a4 [FIX] web: allow navigation by changing the value of browser.location
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

closes odoo/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>
2021-11-30 12:06:07 +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
David Beguin 73399ddc1c [IMP] web: add setting subtitle style
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
2021-11-29 20:11:23 +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
Yannick Tivisse c2f450a7ad [FIX] web: Fix access right issues on external layout prining
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.

closes odoo/odoo#80528

Taskid: 2701251
X-original-commit: 3891ab34740a86a5e795b9fbcb3fb998d705985e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-11-29 14:08:52 +00:00
Hardik Prajapati 1b3b1ce89f [FIX] web: fixed word breaking in pie chart tooltip of graph view
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

closes odoo/odoo#80512

X-original-commit: 5dfd66f03e914fad58deeb45fcc31210293ae162
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-11-29 13:09:44 +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
fja-odoo 80fec8b5ff [FIX] web: fix chineese calendar format
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

closes odoo/odoo#80448

X-original-commit: 7cc502a6eb61bc541dbc27beefed004fcf81e04b
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: fja-odoo <fja@odoo.com>
2021-11-26 14:26:35 +00:00
FrancoisGe b4b55de3ad [FIX] web: Command Palette Debug
After this commit, all users will be able to access the Debug Command.

closes odoo/odoo#80122

X-original-commit: faf208d939ea3a97ae85a31274b061c91e4cef7b
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-25 15:19:45 +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) c0f68e9037 [FIX] web: webclient: navbar: consistently adapt menu items
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.

closes odoo/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>
2021-11-25 09:14:02 +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
Michael (mcm) 8f3c693b7d [FIX] web: fix calendar popover opening
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.

closes odoo/odoo#80318

X-original-commit: c558ae309ff63a26c30ea0196930eb15a279e1dc
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-24 13:17:14 +00:00
Michael (mcm) 4649d9c0a2 [FIX] web: fix readonly patch._super
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.

closes odoo/odoo#80317

X-original-commit: 2090e09c51876b9b8af4097ca8f093a8c19361e0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-24 13:17:10 +00:00
Vincent Schippefilt 66ba6987ba [IMP] web: provide lazy_loaded bundle endpoint
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.

closes odoo/odoo#76361

Task-id: 2576814
Related: odoo/enterprise#21804
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2021-11-23 10:26:08 +00:00
Martin Trigaux a8e50921af [FIX] *: correct typos and English errors
closes odoo/odoo#80181

X-original-commit: efd178daee689192d4e930a075475587038b3e0d
Related: odoo/enterprise#22439
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-22 14:48:04 +00:00
FrancoisGe a8cd4e9315 [FIX] web: Breadcrumb to FormView
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.

closes odoo/odoo#80174

X-original-commit: 3eeaa6b1c6f54be9a87e67140ab57fe8f3a61407
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-11-22 14:48:00 +00:00
Jeremy Kersten 27df588c15 [FIX] *: remove trailing slash from controllers
Follow-up of c1ae086cdb

closes odoo/odoo#80139

X-original-commit: 58ee1a5906e4b2a50fb248085abd9caab97f4c52
Related: odoo/enterprise#22421
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-11-19 18:53:45 +00:00
Bruno Boi 541e3ef38f [FIX] web: rainbowman effect must always use the RainbowMan component
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.

closes odoo/odoo#79962

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-19 12:07:54 +00:00