Commit Graph
247 Commits
Author SHA1 Message Date
FrancoisGe 2853e7d1cf [FIX] web: CP separate namespace and search value
The purpose of this commit is to allow the removal of the search value
without removing the namespace.

Use case before this commit:
1. I perform a search in the homeMenu;
2. The command palette opens with "/" + my search;
3. I realise that my search is wrong and I would like to delete its
contents;
4. I press control+a to select the content of my search;
5. I press the backspace key;
6. The "/" and my search is deleted;
7. I perform a new search;
8. I realize that I forgot to add "/" at the beginning.

This commit will remove the namespace from the input which will allow
the user to delete the search without adding the namespace.

If the user wants to remove the namespace, they will have to press the
backspace key with an empty input.

If the user wishes to change the namespace, they will have to start
their search with that namespace. This will be removed from the input
and replace the old namespace.

closes odoo/odoo#86926

Task-id: 2768527
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-23 18:05:08 +01:00
Adrien WidartandBruno Boi e966caca76 [FIX] web: ignore numpad for hotkeys
To reproduce the issue:
(Need a Windows machine)
1. Install Stock
2. Inventory > Products > Products
3. Try to write the diameter symbol (ALT + 155) in the search bar

Error: When pressing the key '1' on the keyboard, the page is redirected
to the Inventory Overview page

Because of hotkeys, it is not possible to use the Windows feature that
allows users to write ASCII characters with ALT+[numerical code from
keypad].

OPW-2731632

closes odoo/odoo#86981

X-original-commit: a0f419c40a8089571839c2f5a6c50d506faf9a0b
Signed-off-by: Bruno Boi <boi@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2022-03-22 23:30:55 +01:00
Bruno Boi 755cd98853 [MOV] web: move position_hook up one folder
Part-of: odoo/odoo#83646
2022-03-17 10:31:30 +01:00
Bruno Boi 54b7209a3d [REF] web: some API changes for usePosition hook
Changes:
- remove all of o-popper-position... auto applied classes system
- add a onPositioned callback to the options
  Usage
    usePosition(reference, {
      /**
       * @param {HTMLElement} popperElement
       * @param {{
       *  direction: "top" | "right" | "bottom" | "left",
       *  variant: "start" | "middle" | "end"
       *  top: number,
       *  left: number,
       * }} position
       */
      onPositioned: (popperElement, position) => {
          const { direction } = position;
          // ...
      }
    });

Part-of: odoo/odoo#83646
2022-03-17 10:31:30 +01:00
Bruno Boi 615788fbc9 [IMP] web: remove comp.el usage in useposition
As component.el is removed: see https://github.com/odoo/owl/blob/master/CHANGELOG.md#9-componentel-is-removed

Part-of: odoo/odoo#83646
2022-03-17 10:31:29 +01:00
Samuel Degueldre a87dd572a4 [REF] web: remove usage of LegacyComponent from command_service tests
closes odoo/odoo#86352

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-03-14 17:28:30 +00:00
Bruno Boi d82d7c9828 [FIX] web: overlays can be toggled more than once
Issue introduced with 030b1ba

Before this commit:
The hotkey overlays were not toggleable more than once in a row.

After this commit:
They can be.

closes odoo/odoo#86089

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-09 10:24:00 +00:00
FrancoisGe 4cfe0e4b2d [IMP] web: Command Palette Footer Clickable
With this commit, it will be possible to click on the different namespace
in the footer of the command palette to insert the namespace value
directly into the searchValue. The purpose of this feature is to make it
easier to discover how namespaces work.

closes odoo/odoo#82773

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-08 11:03:35 +00:00
FrancoisGe b2058b9942 [FIX] web: CP concurence issue with custom delay
Commit 62ebc97bd8 introduced the
possibility to customise the debounce delay associated with a command
palette search based on namespace. This introduced a concurrency bug
when changing namespace.

Problem:
Let's say we have 2 namespaces with very different debounce delays.
For example, # has 2000 and @ has 0.
1. A user enter "#"
2. He changes his mind before the end of the search. He deletes "#"
and enter "@".
3. The search associated with "@" is resolved before the search for "#".
The associated results are displayed.
4. The search associated with "#" is resolved. The associated results
are displayed.
5. The user does not get the results related to his last search which
are those of "@".

Solution:
When we change the namespace, we will cancel the current search function.

Part-of: odoo/odoo#82773
2022-03-08 11:03:35 +00:00
8a5721bc7d [REF] web: remove LegacyComponent
Before this commit, components used `el` and `trigger` but this works
thanks to LegacyComponent. LegacyComponent has been introduced to ease
the transition from owl 1 to owl 2.

This commit replaces the uses of `el` by `useRef` and `trigger` by
adding callback in props. Without these owl 1 features, components
no longer need to extend LegacyComponent.
This commit also adapts the tests to use `getFixture` instead of `el`.

closes odoo/odoo#85903

Related: odoo/enterprise#25032
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-03-08 09:08:54 +00:00
stefanorigano (SRI) 28f910f5be [REF] *: odoo_ui_icons
Following new policies in terms of product design-language, this commit
will partially revert 546477d reducing the number of `oi` icons.

It will also improve rendering when icons are rendered at our default
font-size (13px), avoiding blur effects when icons use thin lines.

Since fontAwesome will coexists with `oi` longer than expected, the
commit will also review size utility-classes in order to get consistent
result when used in conjunction with fa's ones (notably `fa-lg`).

Part-of: odoo/odoo#85651
2022-03-03 14:19:44 +00:00
xlu-odoo 2629348090 [REF] web: notifications revamp
Notifications have now a new look and SCSS has been cleaned up
accordingly. This commit is part of v16 overall restyle (task-2704984).

task#2719037

closes odoo/odoo#82524

Related: odoo/enterprise#23580
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-03 11:03:45 +00:00
Jorge Pinna Puissant cac3ba62e5 [IMP] test_lint, *: add caughtErrors option to no-unused-vars
All named arguments on the catch block must be used. If for some motive
the named argument on the catch block is not used, its name must begin
with '_'.

closes odoo/odoo#85569

Related: odoo/enterprise#24867
Related: odoo/design-themes#552
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-03-02 13:05:42 +00:00
Jorge Pinna Puissant bc20eb4790 [IMP] test_lint, *: enable no-unused-vars rule
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
Michael (mcm) 4dc2b2e539 [REF] web: use LegacyComponent
This commit replaces Component by LegacyComponent when the component
uses removed features from owl 1 like getting its `el` or `trigger` an event.
Some tests are updated to have less LegacyComponent.

Part-of: odoo/odoo#85389
2022-03-01 09:57:39 +00:00
Julien Mougenot 424e46bcfe [FIX] web: Force proper numbering system for server dates
Before this commit, the numbering system used by luxon to parse and
format dates was the one set by the current locale. This means that
any date sent to and received from the server would also be expected
to use the current locale and numbering system. The consequence of
this behavior is that any domain generated by arbitrary dates would
trigger a server error.

This commit forces the numbering system to 'latn' (browser default) for
dates used by the server.

closes odoo/odoo#85487

X-original-commit: c8ef1fcb2277993f90a8e237dbd415de7d1b88bc
Related: odoo/enterprise#24822
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-02-28 14:47:03 +00:00
Géry Debongnie d90f481448 [REF] web, project: remove the component NotUpdatable
With the new fine-grained reactivity in owl 2, this component is not
necessary any more.

Part-of: odoo/odoo#84314
2022-02-25 12:35:43 +00:00
Bruno Boi d2fc219d52 [FIX] web: protect key navigation in editable
Before this commit
The hotkey service was not taking into account that a new hotkey press
may have been triggered from an editable element.
This led to unwanted behavior, i.e. pressing ArrowLeft on an input
inside a sub Dropdown closed the sub Dropdown instead of navigating
through the text written in the input.

After this commit
The hotkey service now detects if the hotkey press was triggered from an
editable element (any input, textarea or other element with
[contenteditable=true] attribute) and does not dispatch this hotkey,
unless a candidate registered handler has explicitly asked to bypass the
editable protection. In that case, its callback will still get called.

task-2764821

Part-of: odoo/odoo#84969
2022-02-21 20:11:55 +00:00
Bruno Boi d48915e285 [FIX] web: dispatch an hotkey only once
Before this commit, the hotkey service will potentially
dispatch many time the same pressed hotkey.

After this commit, it will dispatch only to the newer
registrations or the first that match in the DOM.

task-2764821

Part-of: odoo/odoo#84969
2022-02-21 20:11:55 +00:00
Bruno Boi 78f85f2725 [FIX] web: repair some keynav in dropdowns
ENCOUNTERED ISSUE:
Unable to close a dropdown with ESC when the focus has been given
to a select element inside the dropdown.

TO REPRODUCE:
i.e. in the searchpanel, go to "FilterMenu > Add Custom Filter" and
open the field select element.
Press ESC once: the field select element closes just fine.
Press ESC a 2nd time: we expect the dropdown to close but nothing occur.

REASON EXPLANATION:
Since 84715436d our Dropdown component uses the 'dropdown-menu'
bootstrap class.
But under some conditions bootstrap stops the keydown events propagation
when the event.target matches the query selector '.dropdown-menu'.

IMPLEMENTED FIX:
This commit refines this selector directly inside the bootstrap library.
This is admittedly a bad practice but:
- this modification is trivial and sensible
- the modified selector is only used locally
  in the bootstrap's 'dropdown.js' file
- the added test should prevent the lost of
  this customization in the future

task-2764821

Part-of: odoo/odoo#84969
2022-02-21 20:11:54 +00:00
Julien Mougenot 915191cb18 [FIX] web: assign numbering system to luxon
Before this commit, the numbering system used by luxon was the default
one set by the browser (in most cases: 'latn'). This caused issues when
translating luxon dates with moment dates, as moment supports some
locales differently (e.g.: ar_001 uses the 'arab' numbering system
while Intl uses 'latn').

To have proper consistency, this commit assigns (as much as possible)
the same numbering systems as luxon for each supported locale.

Warning: since the numbering system is now set according to the user
'lang' parameter, it's now unsafe to use `DateTime.fromFormat(...)` with
static date strings, as they might not be parsable with the current
numbering system.

closes odoo/odoo#84833

X-original-commit: 8bd8b299d57ea930b0549446900bd51d03800041
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-02-19 22:17:32 +00:00
FrancoisGe d84cc6329a [IMP] web: onClose Command Palette
Adds the option to apply an onClose function when the Command Palette
closes.

closes odoo/odoo#84619

Related: odoo/enterprise#24356
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-02-18 14:28:49 +00:00
FrancoisGe 62ebc97bd8 [IMP] web: Command Palette Config Debounce
This commit is intended to make command palette faster. To improve this,
we decided to make the debounce delay configurable by namespace.
We also decided to limit the number of Command displays to 100.

closes odoo/odoo#84227

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-02-17 12:51:43 +00:00
Mathieu Duckerts-Antoine 93ea0d6ff9 [FIX] web: useAutofocus in mobile mode
In https://github.com/odoo/odoo/commit/4308de6aab93630c2c24a2d1d2ffd2db4e1d4b6b, the API of useAutofocus
was modified but only partly leading to problems in mobile mode.
We make the appropriate correction.

closes odoo/odoo#84541

Related: odoo/enterprise#24324
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-15 14:54:52 +00:00
Rémi RahirandLucas Lefèvre 249162b047 [FIX] web: Domain arrayToString support 'in' operator
The function `arrayToString` did not properly support domains containing
arrays of booleans, for instance `[["val", "in", [true, false]]]`. The
array containing the boolean was directly JSON stringified without being
converted to its python equivalent.

closes odoo/odoo#84592

X-original-commit: 62f996e43098dc0f671f1e2cbb36f977ef6a36c9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
2022-02-14 21:36:51 +00:00
Mathieu Duckerts-Antoine 4308de6aab [REF] web: useAutofocus simplified API
We bring two changes to the API of useAutofocus:
    - it takes no parameter, the element focused is the one that is the
      target of a t-ref="autofocus".
    - it returns the element reference instead of a function to call if
      one wants to force the focus on a next patch.

Indeed, having access to the element reference makes it easy to focus
that element but also allow to remove an eventual useRef that would
target the same element. This in turn permits the use of t-ref="autofocus"
alone.

closes odoo/odoo#84306

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-11 11:40:12 +00:00
+2 6d13271aac [REF] web: adapt code to owl 2
Owl 2 changelog: https://github.com/odoo/owl/blob/a9f29c4caad4f32d06be1ec4780572825781cd9b/CHANGELOG.md

Part-of: odoo/odoo#80156
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-02-10 07:46:12 +00:00
Mathieu Duckerts-Antoine 96eb83c0a7 [REF] web: tooltip service replaces useTooltip hook
In preparation for OWL-2, we introduce a new tooltip service that replaces
the hook useTooltip used by the webclient. The main reason for that is
that the implementation of useTooltip had to access el on the components
calling it. Since this won't be possible anymore in OWL-2 (el is ill-defined
in presence of multi root components) we had to find something else.
Another reason is that the useTooltip hook had no reason at all to be a
hook (as attested by the fact that only the webclient needs to call it
to have tooltip on every dom elements).

closes odoo/odoo#84160

Related: odoo/enterprise#24152
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-08 19:11:21 +00:00
stefanorigano (SRI) 4e53953756 [REF] web, mail: apply odoo icons
This commit is part of v16 overall restyle (task-2704984).

enterprise: https://github.com/odoo/enterprise/pull/23848
task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:55 +00:00
FrancoisGe 6daa9188cb [IMP] web: highlight searchValue in CommandItem
With this commit, when you perform a search in the command palette,
the part of the commandItem's name that matches the searchValue will
be highlighted.

closes odoo/odoo#82407

Task-id: 2741837
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-21 09:40:50 +00:00
Achraf (abz) 7c362b0b14 [FIX] web: Infinite loop with datepicker input
Steps:
 - Go into a view and filter on date/datetime
 - Select between
 - change the input max date manually
 - click outside the calendar while remaining in the filter dropdown to "validate" the input
 - infinite loop/crash

Same problem/fix as https://github.com/odoo/odoo/pull/78394 in 14.0

opw-2722797

closes odoo/odoo#83107

X-original-commit: 32e2d88ca0a864c91992b2c522ef21dbcb9787a5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-01-20 17:39:12 +00:00
Julien Mougenot db63ff2259 [REF] web: Owl imports adaptation
In the next version of Owl, all exported terms are directly available
from the top level `owl` object. This commit aims to adapt existing
imports to this new system. This is done by importing any Owl property
used in files at the top, right after the `import` or `require`
statements.

closes odoo/odoo#82736

Related: odoo/enterprise#23609
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-20 11:03:01 +00:00
FrancoisGe 91394ed79d [FIX] web: Command Palette FooterComponent
This commit solves a naming error introduced by commit 1e1b45ea62, the name of a component always starts with a capital letter.

closes odoo/odoo#82629

Related: odoo/enterprise#23285
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-19 16:52:18 +00:00
Samuel Degueldre 53b7d2a632 [REF] web: stop using component ref in dialog tests
This is in preparation for owl2

Part-of: odoo/odoo#82326
2022-01-18 13:40:30 +00:00
FrancoisGe 1e1b45ea62 [IMP] web: Command Palette footer
This commit will change the setting of the emptyMessage and the
footer of the main command palette.
In order to make the command palette footer more customizable, we will
replace it with a Component. For example, using a footerComponent in the
main command palette allows us to adapt its text based on the namespaces
used.

Setting up an empty message:
Before:
```
registry.category("command_empty_list")
        .add("@", _lt("No user found"));
```
After:
```
registry.category("command_setup")
        .add("@", {
            emptyMessage: _lt("No user found"),
            });
```

With this commit, it is possible to add a namespace to the footer tips:
```
registry.category("command_setup")
        .add("@", {
                name: _lt("channels"),
            });
```

closes odoo/odoo#82541

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-12 11:19:00 +00:00
FrancoisGe 52a1d997d2 [IMP] web: custom command palette
This commit adds the possibility to open the custom main command palette.
So it is possible to replace some parts of the default command palette
config.

For example, we will customize the placeholder:
```
    this.command_service.openMainPalette({
        placeholder: "My custom placeholder",
    })
```

This commit also modify the api of CommandPaletteConfig, we replace
namespace by searchValue. Now it is possible to open a command palette
with a value in its input.

For example:
```
    this.command_service.openPalette({
        searchValue: "@test",
    })
```

closes odoo/odoo#81814

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-10 13:52:34 +00:00
Samuel Degueldre 0091259e17 [REF] web: remove datetime-changed event in preparation for owl-2
In owl-2, t-on will no longer be supported on components. This commit
converts the code that used to rely on the datetime-changed event to use
a callback-prop based approach instead.

closes odoo/odoo#81199

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-12-20 20:57:13 +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
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
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
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 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
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
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
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
luvi e756d9bc80 [FIX] web: anchor scroll crash
This commit fixes some issues happening when scrolling
with an anchor in Odoo. When the anchor was contained inside
of a notebook and no scrollable was found, a crash happens.
This fix improves the behavior in notebooks by showing the
correct pane before scrolling in form renderer. The scrollTo
util has been improved to remove duplicate lines and handle
multiple situations (0, one or more scrollables). Tests haven
been written to test such behaviors.

closes odoo/odoo#79935

X-original-commit: 4c2b807d1cb32e52a1b1fb5e6c80fb7e933940bc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-17 13:51:54 +00:00
Aaron Bohy 1bb9cb89c8 [FIX] web: setup luxon locale from user lang
Before this commit, luxon wasn't configured with respect to the
user lang, meaning that months weren't translated (for instance,
in the filter menu, date(time) filter options, or in the datepicker
displayed in the "Add custom filter" sub-drodown).

closes odoo/odoo#79644

X-original-commit: 9530b0a2462aca0938ce315cee262b147b7a5634
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-12 08:25:53 +00:00
Tommy (tong)andAaron Bohy 114a5885ba [FIX] web: rpc error handling: use normal dialog if possible
Before this commit, automated actions could not raise "normal"
errors anymore (e.g. UserError). Indeed, since the wowl refactoring,
it always shows the custom BaseAutomationErrorDialog when an error
is thrown in an automated action, even if it is a standard error
well-known by the framework. Before the wowl refactoring, those
errors were handled normally if possible, and when it wasn't the
case, the custom BaseAutomationErrorDialog was used.

This commit restores that behavior.

Complete steps to reproduce:
- Install base_automation module
- Install an app for the base_automation to trigger (e.g. Sales)
- Turn on debug mode
- Go to Automated Actions
- Create an action with Action To Do is Execute Python Code and the Trigger is On Creation & Update
- Set the model to your app (e.g. SalesOrder)
- Put `raise UserError('Test')` in Python Code section
- Go back to the app, try to create a new record in the model you set for the automated action to trigger
- Compare the result with 14.0

closes odoo/odoo#79611

X-original-commit: d65d742de1b30a00b3ffd872c042e002736f7f6b
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2021-11-10 11:28:15 +00:00
luvi d304be57be [FIX] web: scrolling to anchor working badly
This commit fixes a bug when you clicked on a link related to an anchor.
e.g. an <a> tag with an href="#anchor". The scroll to the element
with id="anchor" didn't happen because the position was not found correctly.
The fix uses getBoundingCLientRect to get more precise positions
of the element with the anchor and the scrollable area.
A test is introduced to check scrolling for multiple anchors in a template
with a more complex structure (Note: the test fails without the fix).
The scroll behaves differently depending if the target is an anchor or
an element. An other test has been added for the command palette about this
behavior.

closes odoo/odoo#79310

X-original-commit: b0da44d62f85d6530f8e568025f7fea25c5454c5
Signed-off-by: FrancoisGe <fge@odoo.com>
2021-11-03 11:48:46 +00:00