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.
closesodoo/odoo#76912
X-original-commit: 7f4bc27702844cf9b9f010a4ab3c1ac077442ecc
Related: odoo/enterprise#21042
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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.
closesodoo/odoo#77206
X-original-commit: 1271ef80fafa4438271af0919dcca229aa20bf81
Related: odoo/enterprise#21191
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#77148
X-original-commit: 582604990e28c329348475f373b03295903ed77e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/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>
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
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
closesodoo/odoo#77109
X-original-commit: 74dc3f654ee5849982b494e46eefb1fc2b4e0c74
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
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', '<', current_date)]"
We add current_date to py_builtin.
closesodoo/odoo#77035
X-original-commit: ade082c5ad9221c82de90ddbe68b814b1487753d
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
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', '>=', (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
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
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
closesodoo/odoo#77002
X-original-commit: c9aa20160cd8b1bc9c9bdcd34bb996b8dfefc291
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/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>
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>
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
closesodoo/odoo#76931
Related: odoo/enterprise#21054
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
closesodoo/odoo#76939
X-original-commit: ea5c7b643be8c902b03a2ae175c051c479e45ed9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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.
closesodoo/odoo#76921
X-original-commit: bc1b14ff8a7d412fbbc5987ed57e2d4cdd00a0a0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/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>
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
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
The debug item "Edit ControlPanelView" is only available if there is
a control panel in the current view.
closesodoo/odoo#76862
X-original-commit: 68cb8d23e2011ed359fc54f3deed6c84290d5c3b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#76793
X-original-commit: ff28db335fa77dadc3198e754f1e0649811fba7b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#76776
X-original-commit: 6ddc9b3256266fc393faaaddb1b49140e6a1990f
Related: odoo/enterprise#20990
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#76634
X-original-commit: 7d24a87a51c8202320ecf9abcfecb8a861463b0c
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
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] 11eb4542abclosesodoo/odoo#76778
X-original-commit: c5ac7fc541cbdb0a7fe7c9d01849bcc9a615a78c
Related: odoo/enterprise#20992
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
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
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
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
In UserMenu Shortcuts Table, we correct the shortcuts for MacOs and
we add the shortcut to open the command palette.
closesodoo/odoo#76614
Task-id: 2646058
X-original-commit: af69aef93a1bec4eccf0813aeacb26e3bd1098ea
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
closesodoo/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>
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.
closesodoo/odoo#76620
X-original-commit: 1e308b270b6b1f6612b256db35b188bd0a2f5493
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#76613
X-original-commit: 53b905d6993b4e25fec574d92429f2ff91501dfa
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
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.
closesodoo/odoo#76576
X-original-commit: 12111f114c096c50adbb87cea9f1dd97dc16c47d
Related: odoo/enterprise#20894
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
- 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
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
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
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
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
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
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.
closesodoo/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>
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 3dd1c0fclosesodoo/odoo#76493
X-original-commit: 4e213f0b93f59cf377271b18eae9765ff9cfbe4f
Related: odoo/enterprise#20847
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>