Commit Graph
14827 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 3f2ffca97a [REF] web: remove compile_lib and view_widget from web
These helpers and component should be moved to web_dashboard, which is the only
place they are used. Also, we want to avoid setting a precedent by putting these
in web.

closes odoo/odoo#76912

X-original-commit: 7f4bc27702844cf9b9f010a4ab3c1ac077442ecc
Related: odoo/enterprise#21042
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-09-27 16:56:07 +00:00
Lucas Perais (lpe) 5208c68f0c [FIX] web: dropdown: avoid positioning in mobile
Before this commit, the positioning of the dropdown (which is powered as a poppover)
was executed all the time.

This commit prevents this behavior in mobile, assuming there is not enough space anyway
to have a proper fixed position and that we should use scrolling instead.

closes odoo/odoo#77206

X-original-commit: 1271ef80fafa4438271af0919dcca229aa20bf81
Related: odoo/enterprise#21191
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-27 05:59:46 +00:00
Francois (fge) 2d8c868363 [FIX] web: do_action open twice error dialog
Before this commit, using a do_action that throws an error opened two
error dialogs.
To solve this, in the compatibility layer, we check that the error has
not already been thrown.

To reproduce the problem, you can execute an action using do_action
which will return an error. For example, an action performing an rpc
and the server returns an error.

You can find an example scenario to test the problem on the 2618694.

closes odoo/odoo#77148

X-original-commit: 582604990e28c329348475f373b03295903ed77e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-24 12:35:21 +00:00
Aaron Bohy 800297064c [FIX] web: useTooltip: clearInterval on willUnmount
Before this commit, the useTooltip hooks didn't call clearInterval
when the component using it was unmounted/destroyed. In practice,
it wasn't an issue because the only component using it was the
webclient, and it is never destroyed. However, for this hook to be
usable in other contexts, it is important to remove this leak.

closes odoo/odoo#77113

X-original-commit: d076afd035ad8fadc5a0774c6c0eec15acb15026
Related: odoo/enterprise#21147
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-24 09:45:44 +00:00
Aaron Bohy 9d98d1e870 [REF] web: useTooltip: use template instead of component
Allowing to specify components inside tooltips to obtain dynamic
and/or html content was a bit overkill and unnecessary: a template
can do the trick and it is easier to define.

This commit thus renames attribute "data-tooltip-component" into
"data-tooltip-template" (the name of the qweb template) and
introduces the "data-tooltip-info" attribute (its value is then
available in the template under the "info" variable).

X-original-commit: 8683a8d762339451e3d9f8706aac86da80510b37
Part-of: odoo/odoo#77113
2021-09-24 09:45:43 +00:00
Aaron Bohy 35ac826f94 [FIX] web: effect: display rainbowman by default
In [1], we rewrote the effect feature in the wowl infrastructure.
However, we lost something in the process: the "type" of effect
(basically "rainbow_man" as it is the only implemented effect)
became a mandatory param, whereas before it simply defaulted to
"rainbow_man" when not set. As a consequence, previously defined
effects in views could crash.

This commit fixes that issue, and reworks a bit the feature by
introducing a registry of effects, which easily allows to add new
effects from the outside. An effect is a function that may return
a Component (and its props) to display.

Most of the diff in the tests is about moving files where they
should be (the effect feature being in core/, the tests must be
in core/ as well, and not depend on the webclient).

[1] 0573acae23

Task 2652927

closes odoo/odoo#77109

X-original-commit: 74dc3f654ee5849982b494e46eefb1fc2b4e0c74
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-09-23 20:18:47 +00:00
Mathieu Duckerts-Antoine 99e77f708e [FIX] web: py.js evaluation of current_date
current_date was absent from py_builtin. For that reason, it was
impossible for the search model to evaluate a dynamic domains like
"[('date_deadline', '&lt;', current_date)]"

We add current_date to py_builtin.

closes odoo/odoo#77035

X-original-commit: ade082c5ad9221c82de90ddbe68b814b1487753d
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-09-23 11:26:10 +00:00
Mathieu Duckerts-Antoine 31c9bcaaca [FIX] web: py.js evaluation of to_utc
The class PyDateTime did not have a method to_utc. For that reason, it was
impossible for the search model to evaluate a dynamic domains like
"[('date', '&gt;=', (datetime.datetime.combine(context_today(), datetime.time(0,0,0)).to_utc()))]"

We implement that method.

X-original-commit: 3ad9a3be64da78d596ee3dc435d4b224728a9e76
Part-of: odoo/odoo#77035
2021-09-23 11:26:09 +00:00
Mathieu Duckerts-Antoine dfa90a7ffc [REF] web: patchDate function
In order to be able to easily patch Date in py_date_tests and elsewhere,
we refactor the code of the legacy and new patchDate functions.

X-original-commit: 0e697c82be80cae9cc993b4be179fec42b8dae83
Part-of: odoo/odoo#77035
2021-09-23 11:26:09 +00:00
Prakash Prajapati a61c2ec715 [FIX] web: prevent translation alert from flickering
Before this commit, the translation alert might briefly appear in
form views displayed in dialogs (on new records), just before the
dialog closes.

Task 2639227

closes odoo/odoo#77002

X-original-commit: c9aa20160cd8b1bc9c9bdcd34bb996b8dfefc291
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-23 07:17:47 +00:00
36988d0edc [IMP] *: use new dropdown in legacy too
This commit replaces the control panel dropdowns with the new <Dropdown/> component, in order to get consistent through the new/legacy views (because the current Odoo version is in a state where some views uses the new infrastructure and some others are still not converted - see odoo/odoo#73311).

The diff seems massive, but it is mostly due to tests adaptations.

closes odoo/odoo#77001

X-original-commit: d679cd0d8ba9a2420e81a42a698763e9be2327e1
Related: odoo/enterprise#21077
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-09-23 07:17:43 +00:00
Mathieu Duckerts-AntoineandAaron Bohy ee2ae9a75b [IMP] web: deploy ui and hotkey as legacy services
This commit deploys some of the new OWL infrastructure services to the
legacy OWL environment.

The deployed services are the UI and hotkey ones.

These are needed because they are the only prerequisites for the new <Dropdown/>
component to get instanciated with the legacy OWL environment.

As the new reporting views infrastructure has been merged (see odoo/odoo#73311),
the current Odoo version is in a state where some views uses the new
infrastructure and some others are still not converted.

So instanciating the new <Dropdown/> component in the legacy OWL env is
something we chose to do in order to get consistent within the control
panel dropdowns behaviors.

X-original-commit: 6f1ab1cd861549484f94a8d40a16ccf338d7dffe
Part-of: odoo/odoo#77001
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-09-23 07:17:43 +00:00
Lucas Perais (lpe) 56dda82a5f [REF] web, *: legacy: lazy loading of legacy reporting views
Since commit 0134495ba5 the reporting
views pivot, graph, cohort are written in full new framework.

Some applications still need the legacy ones, so this commit just implements
the lazy loading of those views.

In stock, report_stock_forecasted has been adapted in order to avoid having
a GraphView override: we now modify the canvas' height in pure JS.

*: board, stock

closes odoo/odoo#76931

Related: odoo/enterprise#21054
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-22 12:22:46 +00:00
William Braeckman e7097fd6e1 [FIX] web: fix calendar quick create removing everything
When an event is currently being inspected by the user, i.e. the popover
is displayed and the user clicks somewhere else on the calendar, we do
not wish to open the quick create menu, only close the popover.
However the code that handled that case was not adapted to the regular
calendar view, only the one from the calendar app and would remove all
data currently displayed.

This commit fixes that issue.

TaskId-2652219

closes odoo/odoo#76939

X-original-commit: ea5c7b643be8c902b03a2ae175c051c479e45ed9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-22 10:58:55 +00:00
Julien Mougenot 6427086210 [FIX] web: Repair web in single module
Since https://github.com/odoo/odoo/commit/344d82ca251bbba8f54e85d6b881cc92f8823f13 :

The `web_editor` module is no longer installed by default in default
databases since it now depends on the `mail` module. This caused a few
bugs inherent to the base modules to surface:

- in the `mock_server` file: performRpc was synchronous and threw
uncaught errors;
- in the webclient scss: the body did not have an assigned with and
height of 100%, which caused some positioning issues.

This commit fixes these problems in the base modules.

closes odoo/odoo#76921

X-original-commit: bc1b14ff8a7d412fbbc5987ed57e2d4cdd00a0a0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-22 06:51:09 +00:00
Aaron Bohy e9961dc5a5 [FIX] web: graph: keep pending filters when toggling a measure
Consider the following scenario on a slow network in a graph view:
 - add a filter (triggers a reload)
 - toggle a measure (triggers another reload, before the first one
   completes)

Before this commit, the new searchParams coming from the first
reload were lost, even though they were still displayed in the
search view.

This commit ensures that we keep the last searchParams when
reloading the graph view.

closes odoo/odoo#76918

X-original-commit: 1719de73099eca0b765237cb47caf44813157b94
Related: odoo/enterprise#21046
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-22 06:50:55 +00:00
Aaron Bohy 5f19d41d32 [REF] web,project: graph: use renderer props convention
By convention, views pass the model instance in props to the
renderer. Moreover, when the renderer needs to perform actions
outside of its natural scope, those callbacks have to be given in
props as well, s.t. the renderer can call them directly (instead
of triggering an event, listened by the parent).

This commit also adds the props validation on the PivotRenderer.

X-original-commit: 0ca538eba780aacca44ab4e34c56d8eed22fa333
Part-of: odoo/odoo#76918
2021-09-22 06:50:54 +00:00
Aaron Bohy cc05e24791 [REF] web: graph and pivot: rework view props
This commit simplifies the props of the GraphView. We only keep
props that are necessary (e.g. for the dashboard view), and for the
others, we find the information in the arch. That way, there's only
one way to do, which is easier to understand.

We also remove the "display" and "title" props from pivot as they
weren't used.

X-original-commit: c26953ef15b0846282bbeccd7cf0de25e1a47392
Part-of: odoo/odoo#76918
2021-09-22 06:50:54 +00:00
Francois (fge) 2de7eb29b0 [IMP] web: move and convert profiling_sweb_view
closes odoo/odoo#76871

X-original-commit: bee8953c3d8b7179bf1f526baa593825f09bfd97
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-20 20:14:07 +00:00
Francois (fge) 97733eae50 [FIX] web: fix Edit ControlPanelView
The debug item "Edit ControlPanelView" is only available if there is
a control panel in the current view.

closes odoo/odoo#76862

X-original-commit: 68cb8d23e2011ed359fc54f3deed6c84290d5c3b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-20 20:14:03 +00:00
Francois (fge) 421a676156 [FIX] web: use makeDeferred from web
closes odoo/odoo#76848

X-original-commit: 2777d187cd72967a1137f851c6c9cc0f9172dcee
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-20 20:13:57 +00:00
Mathieu Duckerts-Antoine 75f8814afd [FIX] crm, web: forecast views
After the conversion of the graph and pivot views done in https://github.com/odoo/odoo/pull/73311,
it was no more possible to open the forecast_graph and forecast_pivot views.
This is due to the fact that the new View component cannot manage a legacy
view: every extension of a converted view must be converted. We thus
convert forecast_graph and forecast_pivot.

closes odoo/odoo#76793

X-original-commit: ff28db335fa77dadc3198e754f1e0649811fba7b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-20 10:54:23 +00:00
Aaron Bohy 4bf3667e40 [REF] web: remove ControlPanel's BottomContent feature
This commit simplifies the API of the ControlPanel by removing a
feature that isn't really necessary. It was used only once, in
web_dashboard, and there are simple alternatives.

closes odoo/odoo#76776

X-original-commit: 6ddc9b3256266fc393faaaddb1b49140e6a1990f
Related: odoo/enterprise#20990
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-20 09:30:04 +00:00
Aaron Bohy 804e83d771 [FIX] web: adapt clickbot to new views
Since d1e227b07 and 242b1caa, the Pivot and Graph don't have the
viewType attribute set anymore.

Moreover, their filters don't have an "a" tag anymore.

closes odoo/odoo#76634

X-original-commit: 7d24a87a51c8202320ecf9abcfecb8a861463b0c
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-09-20 05:58:21 +00:00
Aaron Bohy e6bc5bfde6 [IMP] web: add graph test from legacy
Commit [1] fixed a bug in the legacy graph view and introduced a
test. This was done while we were re-writting the graph view in
owl. This commit adds the test added by [1] in the new graph test
suite.

[1] 11eb4542ab

closes odoo/odoo#76778

X-original-commit: c5ac7fc541cbdb0a7fe7c9d01849bcc9a615a78c
Related: odoo/enterprise#20992
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-09-17 23:59:34 +00:00
Aaron Bohy 040c73fe69 [FIX] web: fix concurrency issue in graph
Let's assume the following scenario in a graph view
 - toggle a filter on a slow network s.t. it takes a while to load
 - while it's loading, toggle a measure

Before this commit, the view was kind of locked after those two
steps, i.e. toggling measures or changing graph mode did not work
anymore (it could be unlocked by interacting again with the search
view though). The reason is that the new filter triggered a
re-rendering of the withSearch component (the parent of the graph
view), thus calling willUpdateProps on the graph view, which reloads
the data. Toggling a measure cancels the current load operation
(via keepLast), and the promise returned by willUpdateProps is thus
pending forever. From that point, only another re-rendering from the
parent (withSearch) could unlock the situation by cancelling the
previous rendering.

To solve this, we use the new Race primitive. It ensures that the
promise returned by load resolves as soon as the view is actually
reloaded (whether it came from the load itself, of by toggling a
measure).

This commit also refactors the pivot model to use the Race
primitive.

X-original-commit: ceebab7128cb9838024029aefe3910a18cf14e44
Part-of: odoo/odoo#76778
2021-09-17 23:59:34 +00:00
Aaron Bohy cc9c229fda [IMP] web: add Race concurrency primitive
This commit adds a new concurrency primitive inspired by
Promise.race, except that it is dynamic (promises can be added to
a Race instance anytime).

X-original-commit: 4a487524d69ac7ede68296ea4e1f51e1b769d642
Part-of: odoo/odoo#76778
2021-09-17 23:59:33 +00:00
Francois (fge) 6e95fda6d0 [MOV] web: move computeAppsAndMenuItems to menu_helpers
X-original-commit: be602afc7e566ab783bcebaf80b8bdb14b6ebba6
Part-of: odoo/odoo#76777
2021-09-17 23:59:20 +00:00
Francois (fge) e0e4d38cdd [MOV] web: move /commands to /core
We move /commands to /core because DebugMenu depends
on /command/command_hook. All the files in /commands depend only
on /core or /commands except for menu_providers which we will move to /menus

X-original-commit: eca8cd478b72d81b2293c22d2c9c41d1f94be16a
Part-of: odoo/odoo#76777
2021-09-17 23:59:19 +00:00
Francois (fge) 0361b60274 [IMP] web: adapts the UserMenu Shortcuts Table
In UserMenu Shortcuts Table, we correct the shortcuts for MacOs and
we add the shortcut to open the command palette.

closes odoo/odoo#76614

Task-id: 2646058
X-original-commit: af69aef93a1bec4eccf0813aeacb26e3bd1098ea
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-17 12:38:57 +00:00
Francois (fge) e13c41a45f Revert "[FIX] mail,web: Change command palette shortcut"
This reverts commit 2623b4591d.

The command+m shortcut on safari is not listenable. Safari prevents to
catch events of some shortcut reserved for OS actions. Command+m is
used to minimize the app. This makes it impossible to open the command
palette on safari. So we decided to use again the command+k (ctrl+k)
to open the command palette.

X-original-commit: ca0e37cc20da907d74245e935416d66a52976c5e
Part-of: odoo/odoo#76614
2021-09-17 12:38:57 +00:00
Mathieu Duckerts-AntoineandMichael Mattiello cad6408e6e [FIX] web: toJSON for date classes
The classes PyDate, PyDateTime, and PyTime used in py.js to evaluate
python expressions did not have a toJSON method. As a consequence, the
dynamic domains manipulating date/datetime but forgetting to use strftime
didn't work anymore. This fix simply defines a toJSON method in the three
above mentionned classes

closes odoo/odoo#76699

X-original-commit: 53eefe36f39e6c9ad355e78bcabbba4e0039aa35
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Michael Mattiello <mcm@odoo.com>
2021-09-17 11:17:45 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Mathieu Duckerts-Antoine e50191e99e [FIX] web: control panel style
The fix 18ea11c99a7e2bd58d7469927352587cb14c76c4 incorrectly set the rule
o_control_panel .o_cp_bottom_left { display: inline-block } to fix a
problem with the graph view buttons in mobile mode: the graph view has
many buttons and they were put on the same line pushing the view switcher
far too rigth. But the above rule had some other unexpected effects.
For example, an action menu button was put incorrectly on an different line
from the button line. Here we simply fix the css rules that regulate on witch line
the control panel buttons are put and their spacing.

closes odoo/odoo#76620

X-original-commit: 1e308b270b6b1f6612b256db35b188bd0a2f5493
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-16 06:04:08 +00:00
Francois (fge) 14cbcc07dd [FIX] web: concurrency issue in command palette
Before this commit, if the user searched the command palette and pressed
the enter key without waiting for the rendering, then the command executed was incorrect.

The "inputPromise" promise used to know if the new commands were loaded correctly.
This one did not wait for the resolution "setCommands" called by "onSearchInput".
So we modified the "debouncePromise" utility to make sure that it waits for
the resolution of the function given to it before resolving its promise.

closes odoo/odoo#76613

X-original-commit: 53b905d6993b4e25fec574d92429f2ff91501dfa
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-16 03:40:39 +00:00
Francois (fge) 7e1737cb0f [FIX] web: scroll in the command palette on firefox
Before this commit, it is impossible to scroll with the arrows
in the command palette on Firefox.

Using a <span> to wrap the commands made the offsetTop value wrong on
Firefox and the offsetHeight value wrong on Google Chrome.
So we replaced the <span> with a <div> which solves the problems. So we
will be able to use this <div> in the scrollTo and not its child.

X-original-commit: f52eb7ee6b93aef0c5b80744127548b0a2fdb4fd
Part-of: odoo/odoo#76613
2021-09-16 03:40:38 +00:00
Benoit Socias d3c9a9cc00 [IMP] web, web_editor, website: make gradients editable
task-2599771

X-original-commit: bfb97ce3ed829905e943f18cd83107a92e695e76
Part-of: odoo/odoo#76608
2021-09-15 23:51:13 +00:00
Benoit Socias d43674b7d4 [FIX] web: update colorpicker UI when setting color
Before this commit the colorpicker UI remained unchanged when the
setSelectedColor method was called, and it also triggered a color
preview event.
This was not a visible issue as long as the popup was closed every time
a color was selected, but the popup now remains open when editing a
gradient.

After this commit the colorpicker UI is updated to show the color
changes when setSelectedColor is called, and it does not preview the
color being set.

task-2599771

X-original-commit: 4abf222b532d1f42d9699f400e856b1aaddb92b4
Part-of: odoo/odoo#76608
2021-09-15 23:51:13 +00:00
Aaron Bohy 6e4790ad66 [REF] web,board: rename some useSetupAction params
exportLocalState -> getLocalState
exportGlobalState -> getGlobalState
saveParams -> getContext

Moreover, the last one no longer returns an object with a "context"
key, but rather directly returns the context itself.

closes odoo/odoo#76576

X-original-commit: 12111f114c096c50adbb87cea9f1dd97dc16c47d
Related: odoo/enterprise#20894
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-15 15:22:25 +00:00
Aaron Bohy e830968efe [REF] web: views: factorize sample data logic
This commit factorizes the sample data logic to the Model and
useModel hook. That way, nothing as to be done in concrete models
anymore.

This commit also ensures that searchParams given to the view are a
deep copy of what relies in the SearchModel. Before this commit,
the PivotModel cloned them in its "load" method. It is now done
in the SearchModel for every views.

X-original-commit: 0f43b7994b6963644cea5b694ba6b07df7af8989
Part-of: odoo/odoo#76576
2021-09-15 15:22:25 +00:00
Aaron Bohy fbf9960dde [REF] web: several small refactorings of pivot and graph
- PivotModel: methods are protected, not private
 - PivotModel: rename meta into metaData (same as in GraphModel)
 - GraphView: use the "useEffect" hook
 - PivotView and GraphView typo: ArchParser is a class

X-original-commit: 71059a4887cf208552e4932ed2f3b6f53d75c369
Part-of: odoo/odoo#76576
2021-09-15 15:22:24 +00:00
Aaron Bohy c4b76c66a4 [FIX] web: pivot: highlight correct column in comparison mode
When hovering header cells in the pivot view, the whole column is
highlighted. In comparison mode, a wrong column was highlighted
when hovering a measure.

X-original-commit: 751c2a78d375d67fc7e2cc20342d29188a3d11b5
Part-of: odoo/odoo#76576
2021-09-15 15:22:24 +00:00
Aaron Bohy cf6f9141f3 [FIX] web: pivot: do not alter table while reloading
Before this commit, it was possible to alter the table while it
was being reloaded (e.g. because a filter had just been applied,
or a measure had just been toggled). Those operations that altered
the table (e.g. sort rows, add groupby, expand group, close group)
typically cancelled the reload, which led to a situation where the
table was frozen, and only another reload from the search could
unfreeze it.

With this commit, we simply ignore all operations on the table
itself when it is being reloaded.

X-original-commit: dcdec74dca65e91998d90e3da0c14d8ee3df1567
Part-of: odoo/odoo#76576
2021-09-15 15:22:24 +00:00
Aaron Bohy 648caa59be [FIX] web: pivot: can flip axis while reloading the data
Before this commit, if the user clicked on flip axis while the
data was being reloaded (e.g. just after applying a filter), the
reload was cancelled, and the axis wasn't flipped.

With this commit, we wait for the data to be loaded, and then
flip the axis.

X-original-commit: 5dc0631e339d04cc9f696490e73cf85d45b918fa
Part-of: odoo/odoo#76576
2021-09-15 15:22:23 +00:00
Aaron Bohy a9bde08f98 [FIX] web: fix concurrency issue in pivot
Let's assume the following scenario in a pivot view
 - toggle a filter on a slow network s.t. it takes a while to load
 - while it's loading, toggle a measure

Before this commit, the view was kind of locked after those two
steps, i.e. toggling measures, expanding groups, flipping axis did
not work anymore (it could be unlocked by interacting again with the
search view though). The reason is that the new filter triggered a
re-rendering of the withSearch component (the parent of the pivot
view), thus calling willUpdateProps on the pivot view, which reloads
the data. Toggling a measure cancels the current load operation
(via keepLast), and the promise returned by willUpdateProps is thus
pending forever. From that point, only another re-rendering from the
parent (withSearch) could unlock the situation by cancelling the
previous rendering.

X-original-commit: b9278e07b9ff01e608ccba6f4602eb9069213a46
Part-of: odoo/odoo#76576
2021-09-15 15:22:23 +00:00
Aaron Bohy 932de2fc0f [FIX] web: pivot: can toggle several measures at once
Before this commit, if the user quickly clicked on several measures
(before the reload is over), only the last click was taken into
account. With this commit, all changes are aggregated such that we
only display the final result, with the desired measures.

X-original-commit: a4bae57e1f3b095a4e2d35b3da424c34df59b8dd
Part-of: odoo/odoo#76576
2021-09-15 15:22:23 +00:00
Jorge Pinna Puissant d9303a8448 [FIX] web: fix multiple display errors
This commit will fix some display errors :
 - The margin space between two btn-group on the control panel was too big;
-  The "Group By" menu was lacking an option to add the "fa-caret-down" to looks like other
    Dropdowns;
- The "Group By" menu on the graph view, when used as a subview, has been place in its own
    btn-group to behave exactly as the "Measures" menu;
- The background of the headers on the pivot table wasn't always gray;
- Some borders of the pivot table were missing.

closes odoo/odoo#76529

X-original-commit: 0ffe18927c2f086529de168b5665766a1b9261f7
Related: odoo/enterprise#20872
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2021-09-15 06:35:00 +00:00
Bruno Boi 3cd7ffdc6b [FIX] web: falsy group names in list view
When a group has a falsy value (e.g. if grouped by an integer field having a "0" group), make sure to display its proper name instead of "Undefined".
Off course, boolean fields are still showing "false" name if it is the case.

This issue was introduced with 3dd1c0f

closes odoo/odoo#76493

X-original-commit: 4e213f0b93f59cf377271b18eae9765ff9cfbe4f
Related: odoo/enterprise#20847
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2021-09-14 15:10:15 +00:00
Bruno BoiandMohammed Shekha 6957a614d2 [IMP] web: test coverage for many2many grouping
Add testing coverage for m2m grouping feature introduced by cbc9f3c

Linked PR: odoo/odoo#74985

task-2633123

X-original-commit: a6296f8952b27c597d017332e865d5ca1bd0adac
Part-of: odoo/odoo#76493
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-09-14 15:10:14 +00:00
Mathieu Duckerts-Antoine 477462d024 [FIX] web: favorite domain is a string
Since the refactoring of the search model https://github.com/odoo/odoo/commit/aeb8e49972f871b0c9b07c507987ee77cf5e8abd,
the new favorite items were created with a domain with the wrong type:
Array instead of string. Thus it was impossible to share the search
state with a legacy view when a new favorite was created. We now set
correctly the domain key of a favorite.

closes odoo/odoo#76368

X-original-commit: 2db799d53ad8e765ac864e27e5734046e0491ea9
Related: odoo/enterprise#20778
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2021-09-14 15:09:58 +00:00