Commit Graph
2650 Commits
Author SHA1 Message Date
Aktiv Softwareand"Aaron Bohy <aab@odoo.com>" abd8773c78 [FIX] web: action service: handle target "main"
The target "main" feature has been lost during the conversion of
the ActionManager into the action service. An action with target
"main" should always clear the breadcrumbs. This commit
re-introduces the feature.

Fixes #83865

closes odoo/odoo#87610

X-original-commit: 78ec7281ed550eb24629c1b81445b753314d292f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Aaron Bohy <aab@odoo.com>"
2022-03-31 13:33:05 +02:00
Waleed Mohsen c31423a756 [FIX] web: navbar: set action id in menu href
Before this commit, the href attribute of menu elements didn't
contain the "action=xx" part but only the id of the menu.

closes odoo/odoo#87570

X-original-commit: 6b8242ee1918b784dfdb2160cca6df1c165a824b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-30 16:34:04 +02:00
Hubert Van de Walle (huvw) 0097bd77e9 [FIX] web: the search bar input should be trimmed
Steps to follow

  - Go to the Sales app
  - Search for a entry with a space at the end
  -> No results are returned

The search input should be trimmed, it was in 13.0

opw-2803156

closes odoo/odoo#87529

X-original-commit: 06817417e190d64ab6b0fc6151e02b6090b1fd39
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-03-30 12:06:38 +02:00
luvi 90695d16df [FIX] web: fields _onClick handler triggered twice
This commit fixes a bug present in FieldEmail and
FieldPhone where the handler on the click event was
triggered twice and was not preventing the field to
turn into quick edit mode appropriately.
A test has been added for EmailField to ensure the
correct behavior

PR enterprise: odoo/enterprise#25506

closes odoo/odoo#87196

X-original-commit: 852e084c355e9be77c693b32bf1119570e4d49d0
Related: odoo/enterprise#25558
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-28 12:56:52 +02:00
Yolann Sabaux dd239a604a [FIX] web: display_name in analytical tag not displayed
Steps to reproduce:
- Install accounting
- Create more than 6 analytical tags
- Create an invoice
- Create a payment
- Go in Accounting>Actions>Reconciliation, tab Manal Operations
- In the field Analytical Tag, click on 'Search More' and selected 1 or multiple tags

Issue:
Void tags are displayed

Solution:
Fetch the field `display_name`

ref commit: 84f0644802865c6454014059842eb6a9d4fd40e4
opw-2734029

closes odoo/odoo#87311

X-original-commit: 936bad32cf1024570da4880ccc5375b02b30c1c2
Related: odoo/enterprise#25631
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-28 10:46:28 +02:00
tsm-odoo 2e690b4aa3 [IMP] mail, *: make mockserver autofill relational fields' inverses
*: web, website_slides.

Specifying both side of a relation when seeding test data is cumbersome.
Let startServer method handle it.

task-2792108

closes odoo/odoo#86939

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-25 18:38:54 +01:00
Hubert Van de Walle (huvw) f1fa85fe65 [FIX] web: FieldBinaryImage size attribute not applied correctly in CSS
Steps to follow

  - Go to the product page
  - Open studio
  - Click on the picture and set the size to large
  - Save and quit studio
  -> The size doesn't change

Cause of the issue

  Studio sets the size attribute on the field as `[0, 270]`
  This means the picture should have a height of 270px and an unspecified width.
  But for that to work, we need to handle the case were only one
  dimension is set.

opw-2745625

closes odoo/odoo#87226

X-original-commit: 50368a9db8ac67986cf64ff84ee625cbf7a90a1f
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-03-24 22:28:43 +01:00
Aaron Bohy e5db9d8743 [FIX] web: action service: concurrency issue
There is a concurrency issue in the action service:
 1) be in an action with several views
 2) execute another action (e.g. by clicking on a menu)
  -> [calls the route "/web/action/load", and it takes a while]
 3) meanwhile, click on another view in the view switcher

If the call to "/web/action/load" is long enough, it may happen
that the view requested in step 3 is briefly shown before the
action associated with the menu clicked in step 2.

In this scenario, the action of step 2 should never be displayed,
because the user requested something else afterwards (in this
case a switch view).

One can produce a similar issue when restoring a previous action
of the breadcrumbs instead of switching view.

This commit fixes those two issues by registering a resolved
promise in the keepLast (concurrency utils), s.t. it "cancels"
the potential current operation (in this case, the call to
"/web/load/action").

closes odoo/odoo#87204

X-original-commit: fb9c8cd6fee476d2506b8c1338bf88c4520ea7b6
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-24 21:38:44 +01:00
Julien Mougenot a5cce9f592 [FIX] web: Empty cache when editing favorites
Before this commit, the view service kept the same cache information
even thought favorite filters would be created or deleted. This caused
inconsistencies when the interface tried to reload views that would
access the cache and display outdated information.

Now the related views cache keys are invalidated when favorite filters
are created or deleted.

closes odoo/odoo#76507

closes odoo/odoo#87031

X-original-commit: 84e260e4ecad5116def4d9dcdd0b35d7e87fa45d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-23 19:25:05 +01:00
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
Yolann SabauxandIucapad 701293dbd8 [FIX] web: allow user to scroll horizontally
Steps to reproduce:
- create a contact with a very long name
- create a quotation
- in customer, type the first letter of the very long customer's name
- try to use the horizontal scroll bar

Issue:
close window on horizontal scroll

Solution:
Discriminate an horizontal scroll from a vertical scroll
A test has been added as well as the triggerScroll utility function
to allow proper tests when scrolling on elements

opw-2777443

closes odoo/odoo#86744

X-original-commit: e0b26496196bd4ee39fa06e1a3274982d2c7fb12
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Iucapad  <luvi@odoo.com>
2022-03-22 19:39:40 +01:00
fja-odoo 59e7d10ed4 [FIX] web: fix filter between datetime
In a recent fix, the default values generated for datetime fields in
custom filter was incorrectly set, as the returned date objects were
lost instead of being assigned.

This commit restores the intended behavior.

closes odoo/odoo#86538

X-original-commit: 2720c5be24a1324c058eaaa0a6a7c627f92e856c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-17 10:31:40 +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
Mathieu Duckerts-Antoine 7331901246 [FIX] web: action service: server action with html help returned
A server action sometimes returns an action with a help key.
That help was not marked up, leading to an incorrect display of that help.

closes odoo/odoo#86170

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-11 07:54:08 +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
Samuel Degueldre 687b8d0372 [REF] web: give concrete views ownership of their root element
This will be useful to allow concrete views to attach event listeners to
their root element among other things.

closes odoo/odoo#85891

Related: odoo/enterprise#25030
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-09 09:23:55 +00:00
Audric Onockx (auon) 6ae3fc50c5 [FIX] web : disable archive when active is readonly
Steps :
Install Sale / E-commerce.
Create product P (price = 100).
Create price list L aka product_pricelist.
Create price rule R (product = P, price = 50) aka product_pricelist_item.
Go to product P > Price Rules > archive R.

Issue :
This should not be possible, as product_pricelist_item.active is a
readonly field (related to pricelist_id.active).

Fix :
Make BasicView.controller.archiveEnabled depend on that.

opw-2752184

closes odoo/odoo#86018

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-08 14:59:05 +00:00
Hubert Van de Walle (huvw) 356e6aa4f3 [FIX] web: load search panel after switching view type
Steps to follow

  - Go to the Rental app
  - Switch to the pivot view
  - Refresh the page
  - Switch to the list view
  -> The search panel has not been correctly loaded

Solution

  Check if the section values contain any value other than the default one.
  If not, they need to be loaded.

opw-2710619

closes odoo/odoo#85866

X-original-commit: f61816acac04b76b734286165dcb660f9afb5a8b
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-03-08 11:03:39 +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
Aaron Bohy 36bd5b1699 [IMP] web: allow to access wowl services in legacy
This commit introduces the "useWowlService" hook. This hook allows
Owl components that use the legacy env (not the one of the
webclient for instance, typically called the "wowl" env) to access
services from the wowl env. Its API is the same as the classical
"useService" hook.

closes odoo/odoo#85769

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-03-03 16:18:03 +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
3f086af2fd [REF] web: Layout: simpler and more generic API
With owl2, the `el` of components if no longer available. One must
use a t-ref instead. However, higher order components don't have
their own html element. This was the case of the View component.

However, it makes sense for this component to be the owner of the
view root element, which was previously owned by the Layout.

This commit refactors the View/Layout architecture s.t. the root
element is now owned by the View, and simplifies/generalizes the
Layout in the process. The Layout is no longer tied to the notion
of views, and can thus be used in client actions as well.

closes odoo/odoo#85639

Related: odoo/enterprise#24903
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Michael (mcm) <mcm@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-03-03 09:10:50 +00:00
Aaron Bohy e1e6c42d99 [REF] web,*: make action scrolling helpers stop using comp.el
*crm, project

With owl2, the `el` of components is no longer available. It still
works in Odoo on LegacyComponent, which has been introduced to ease
the switch from owl1 to owl2, and we're now incrementally removing
it.

With this commit, the action scrolling helpers no longer rely on
component.el, meaning that views using them (through the hook
`useSetupAction`) no longer need to extend LegacyComponent.

More specifically, we move the action scrolling helpers from core/
to webclient/actions, as those helpers make no sense outside the
context of actions (and thus are unnecessary in the frontend).

Tests have been adapted as well.

closes odoo/odoo#85631

Related: odoo/enterprise#24902
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-03 07:36:55 +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
Jorge Pinna Puissant 221412630d [FIX] web: extend the timeout when using QUnit.debug
This commit will also ensure that the document is ready before adding
the debug class.

Part-of: odoo/odoo#84314
2022-02-25 12:35:43 +00:00
Jorge Pinna PuissantandGéry Debongnie 09b4668c6b [REF] *: adapt code to owl2 with fine-grained reactivity
On most of the cases, the fine-grained reactivity is bypassed by:
- Setting the optional `deep` argument as `true` on the renderer
    function. This will force a render to update all child components.
- Changing some objects from reactive to non-reactive using `toRaw`
    function.

Part-of: odoo/odoo#84314
Co-authored-by: Géry Debongnie <ged@odoo.com>
2022-02-25 12:35:43 +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
Achraf (abz) 2c39189e53 [FIX] web: Add support for () in domain editor for studio
If a report contains a t-if with something like `field in ('a', 'b')`
as a condition, a crash occurs if you try to modify the 'Visible if'
field in the report editor because the domain editor doesn't support parenthesis.

This commit adds this compatibility based on the case of `[]` which is essentially the same thing

opw-2738343

closes odoo/odoo#85331

X-original-commit: bd76793397cb88e12fce4ffc886eefbce0b54975
Related: odoo/enterprise#24722
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-02-25 06:25:04 +00:00
Nicolas Bayet 69ea40215b [FIX] mass_mailing: show media modal when fullcreen
Whenever the user clicked on the fullscreen in mass_maliing, then
trying to show the media modal was not possible as the div that
contains it was hidden.

Task-2731907

closes odoo/odoo#85314

X-original-commit: 4026bc2075b7109dd18471aabf11ff3f76d6c57d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-24 14:37:31 +00:00
Achraf (abz) edcbd4a196 [FIX] web: Star a product via sales form
For the moment we cannot star a product from the form of sales view

Steps:
    -Sales/Quotation
    - Create new quotation
    - Add a new product in the order lines
    - Open product form from External link
    - Try to star product

Because of the quickedit the onClick is called when it shouldn't,
the solution would be to rename the onClick function so that it
doesn't interfere with the quickEdit.

opw-2759063

closes odoo/odoo#85242

X-original-commit: edafd9fe49b1e4c73ee1768efc3df26b463b2f14
Signed-off-by: Achraf <abz@odoo.com>
2022-02-24 07:17:44 +00:00
Samuel Degueldre 6daa2d01b7 [IMP] web, *: use MutationObserver to neutralize image src in tests
*: mail, mrp

Previously, to prevent images and iframes from making  GET requests in
tests, we would listen for the DOMNodeInserted event. This event is
deprecated and should not be used. Additionally, we weren't listening
for attiribute changes for performance reasons, which would result in
some GET requests still being made when an src attribute was changed.

This commit changes the mechanism that is used to do this from mutation
events to a MutationObserver which is not deprecated, and now also
listens for attribute modifications as MutationObservers can be
configured to only listen for changes to certain attributes, greatly
alleviating the performance impact of listening for those.

This mechanism has also been enabled globally by doing it once in the
test setup code, instead of requiring one to call a specific helper, as
we never want to make real requests during tests.

Some tests have been adapted to this new behaviour.

closes odoo/odoo#85216

Related: odoo/enterprise#24665
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 15:07:59 +00:00
Géry Debongnie 649c037ab0 [IMP] web: update owl to last version
closes odoo/odoo#85197

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 13:58:00 +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
Andrea Grazioso (agr-odoo) a358096aec [FIX] web: lost sign between -1 and 0
Create a credit note for an amount between 0 and 1, confirm it.
In Accounting app, open Reporting -> Invoice Analysis
Switch to Pivot View
The credit note amount will be positive

This occur because in `insertThousandsSep` the number -0 is converted
to "0" (string), thus losing the sign before saving it

opw-2759964

closes odoo/odoo#84946

X-original-commit: c71d4c2349e623a4bcc49c2318fbbc9de08e0fa4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-02-21 10:28:28 +00:00
Mathieu Duckerts-Antoine 0ae13be7de [FIX] web: action service: button action with html help
The method call_button sometimes returns an action with a help key.
That help was not marked up, leading to an incorrect display of that help.

closes odoo/odoo#84869

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-21 08:41:37 +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
Julien Mougenot f6b051a828 [IMP] web,*: Deterministic mock server sorting
This commit orders the records coming from the mock server the same
way they are ordered by the ORM, while also allowing it to support
multiple levels of orderby.

This has been done to increase consistency in the test suite and provide
a more accurate representation of how records would be returned by the
actual server.

Some tests performed their assertions based on this previous
undeterministic system and have been adapted, either by altering
the base setup or the assertions themselves.

closes odoo/odoo#84718

Related: odoo/enterprise#24509
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-18 15:30:39 +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