Commit Graph
14961 Commits
Author SHA1 Message Date
stefanorigano (SRI) 6f4f3699bf [ADD] web: bs5 utility-classes, add positions
closes odoo/odoo#85804

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-04 17:30:25 +00:00
Brieuc-brd 070455953b [IMP] web: keep consistency with legacy pager
After the revamp of the pager, the Legacy Pager was broken because it
used the same SCSS file. This commit adds some BS classes on the Legacy
Pager to keep consistency between both versions while waiting for the
removal of the legacy one.

task-2733437

Part-of: odoo/odoo#82866
2022-03-04 15:00:47 +00:00
Brieuc-brd 623d67d254 [IMP] web: pager scss revamp
This commit simplifies the SCSS of the Pager component.

task-2733437

Part-of: odoo/odoo#82866
2022-03-04 15:00:47 +00:00
Brieuc-brd 5097bbd595 [ADD] web: bs5 utility-classes, add gaps
Define "Bootstrap v5 ready" utility-class to handle gaps.
This class definition can be safely removed after migrating to v5.

task-2733437

Part-of: odoo/odoo#82866
2022-03-04 15:00:47 +00:00
Géry Debongnie 816e6ce374 [REM] web: remove es6 promise polyfill
Since Odoo now accepts ES2019 code anyway, I think that this polyfill
can safely be removed, to reduce assets size.

closes odoo/odoo#85800

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-03-04 10:08:45 +00:00
Géry Debongnie ff7dc5ae8a [IMP] web: update owl to last version
closes odoo/odoo#85773

Changelog: https://github.com/odoo/owl/releases/tag/v2.0.0-beta.2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-03 17:13:45 +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
Samuel Degueldre 6d04d62117 [IMP] web: prevent committing files that will fail test_eslint
Currently, we lint and auto-format non-legacy files in web. The tool
that we use for this linting and formatting unfortunately does not
propagate any linting errors except for parsing errors. This means that
it's possible to commit files of which we know in advance that they will
break CI. This commit simply relints the files in a standalone manner
after they've been formatted, so that if there is a linting error, the
commit will be aborted.

It is still possible to commit non-conforming code (eg to save work in
progress before switching branches) by committing with the --no-verify
git flag

closes odoo/odoo#85727

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-03 10:07:49 +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
Brieuc-brd 25945391e2 [FIX] web: remove unwanted bg in tables
Changes made in the commit 27bd6a681037d2794dac2453d7064be3a8d5bb36
apply a white background in every tables and create visual issues
(e.g. the `o_inspector_table` on the right in `documents`).

This commit removes this global rule and applies a `bg-white` only to
the pivot view.

task-2731553

closes odoo/odoo#85642

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-02 18:46:08 +00:00
xlu-odoo bc4127ad69 [REF] web: dialog, simplify scss
Part of the overall v16 SCSS optimization/restyle (task-2704984).
Additionally, this commit will fix the border-radius of modals that
should be rounded in community.

task-2734531

closes odoo/odoo#83128

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-02 18:45:55 +00:00
Géry Debongnie 8c266b24c9 [IMP] web: update owl to last version
closes odoo/odoo#85671

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-02 15:18:52 +00:00
Aaron Bohy d40e0e8242 [FIX] web: FieldBoolean causing non deterministic issues
The FieldWrapper and the owl compatibility layer aren't bullet
proof. They allowed us to write new fields in Owl and use them
below legacy views, but in some tricky situations they can produce
undesirable race conditions. In particular, the FieldBooleanOwl
sometimes produces a crash in tours, making runbot builds fail
randomly.

This commit makes a special case for "boolean" when determining
which field widget/component to use: we always take the legacy
FieldBoolean, s.t. the FieldBooleanOwl is no longer used in
views. This is obviously not the perfect solution, but those
issues are really hard to reproduce in practice (it's rather
a concern for tour tests). Moreover, that FieldWrapper/compatibiliy
layer architecture is about to be removed anyway, as we are
rewritting everything with a top-down approach, including views
and fields.

Runbot build errors: 2158 3232

closes odoo/odoo#85573

X-original-commit: f74f81543c1d899dbb0dc201d26a460fb8ae61ac
Related: odoo/enterprise#24869
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-02 13:06:03 +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
Jorge Pinna Puissant 19e775b3cc [IMP] web: add the new test_lint eslint rules to the tooling
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
Adrien Dieudonne 4e1e762c53 [IMP] web: move BS5 utility classes in a dedicated file
Waiting the complete migration, some classes needs to be available to already
migrates xml files.

This file will be deleted once we're done.

closes odoo/odoo#85586

Task-id: 2704984
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-01 13:46:50 +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
Michael (mcm) d6946775a2 [IMP] web: introduce LegacyComponent
This commit introduces LegacyComponent and removes patches on Component.
LegacyComponent is used instead of Component when the component
uses features from owl 1 like getting its `el` or `trigger` an event.

Part-of: odoo/odoo#85389
2022-03-01 09:57:39 +00:00
Pierre-Yves Dufays 354b9e8ed2 [IMP] web, base: export field res_partner.name by default in import-compatible
mode

Purpose:

Include the name of the partners so that:
- it can easily be updated
- it is easier for users to recognize who is who

To generalize this modification, a new attribute has been added to the model
field descriptor (odoo/fields.py): default_export_compatible.
Setting this value to True on a field of a model will force that field to be
included by default in the exportation when "import-compatible export" is
selected.

Specification:

If the user goes:
    Contacts > List view > Select Records > Action Export
	     >  I want to update data
The field name is selected by default

The fields selected by default for export are the columns of the list so that
what is exported by default is what the user sees on the screen.
The display name is one of the column but is not importable.
When the option "I want to update data" is selected, only field that are
compatible for importation are selected and then display name is no longer
selected.
With this modification, the name is selected instead.

Technical:

- a new attribute "default_export_compatible" has been added in odoo/fields
- the controller /web/export/get_fields that lists the fields available
for exportation has been modified to add a default_export attribute on each
returned field. This new attribute is set to True when import_compat is True
and default_export_compatible is True on a given field.
The client uses that information to force by default the field for exportation.

Task 2734222

closes odoo/odoo#83697

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-28 16:33:50 +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
Julien Castiaux 8639f9b257 [FIX] website: restore debug mode in website pages
Install website, create a custom web page, we'll call it page_1. Ensure
you are not in debug mode (go to /web/health?debug=0 to disable it).
Open the web page enabling the debug-mode /page_1?debug=1, the page
opens but the debug mode is disabled.

Because web pages are served using another routing mechanism than
controlers we have to ensure we load the debug query-string in those
mechanisms too.

closes odoo/odoo#85340

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-28 13:53:09 +00:00
Thibault Delavallée 2a3d8dd1c2 [MOV] various: move ir.qweb.fields code into right files
When working on qweb fields it is difficult to find some custom override as
they are never in the right file. Finding them is always a bit of random pick.

Task-2607416

Part-of: odoo/odoo#74171
2022-02-28 11:07:39 +00:00
Pierre Paridans 7df7ecae9b [FIX] auth_totp,web: TOTP login from mobile apps
Since PR odoo/odoo#78857 , the TOTP authentication support is broken
when used inside either Android or iOS mobile apps.

Due to our inability to update the iOS app (following review from
Apple), this commit aims at restoring the bare minimum requirements to
make the current mobile apps (specially iOS but also Android)
authentication workflow works.

As extended explanation:
- Set-Cookie header is expected to be sent even when session_id hasn't
  changed (iOS specific).
- Successful credentials check on `/web/session/authenticate` expect a
  successful response with a result containing `uid` set to `null` to
  mark the need of an additional totp handshake (both platforms).

closes odoo/odoo#85463

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-02-26 13:41:23 +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
Géry Debongnie f96c88ee1a [IMP] web: update owl to version 2.0.0 with fine grained reactivity
Changelog : https://github.com/odoo/owl/blob/7845304b7e9cca465ec94af6b1b5272dadc70891/CHANGELOG.md

Part-of: odoo/odoo#84314
2022-02-25 12:35:43 +00:00
Samuel Degueldre 3620de052a [REF] web, *: remove/deprecate useless code in main web controller
*: website_sale_coupon, test_apikeys

The do_search_read method was only used in a single place: the
search_read controller, whose entire function body was just a function
call. The content of the do_search_read method has been moved to the
search_read controller.

The search_read controller is still pretty useless: it's basically
equivalent to making an RPC on a model and calling the method
web_search_read. As such, this controller should be removed, but lots of
code depends on it and adapting all the code that uses it is out of
scope for this PR. It will hopefully be removed alongside the legacy
views in the webclient (which are its main users).

The call_common method and /web/dataset/load route are completely
unused.

The /web/dataset/call controller is used in only two places and can
trivially be replaced with a call to /web/dataset/call_kw

The non-route methods were removed and the route methods now emit a
deprecation warning telling the user what to use instead.

closes odoo/odoo#84811

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-25 07:35:40 +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
Antoine Guenet f1b26335a2 [FIX] web: properly bind colorpicker to its owner document
In mass_mailing, the colorpicker is in an iframe. There was code to make
sure it was bound to its owner document but that code was faulty since
it was executed before the colorpicker was appended to the DOM. As a
result, all features of the colorpicker that relied on the position of
the mouse (eg, selecting a color in an xy selector by dragging a cursor)
were broken.
This fixes it by using the owner document of the parent class' editable
if defined, rather than that of the parent class' element.

task-2778415

closes odoo/odoo#85329

X-original-commit: a19d81bcab978150cf01f1ae85543adc5cb92e5e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-24 15:38:58 +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
FrancoisGe aecd91ba52 [FIX] web: open debug tools in the command palette
The commit 62ebc97bd8 introduces a bug
that makes it impossible to use the Command "Debug tools...". When this
Command is called, a crash happens.

closes odoo/odoo#85267

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-24 13:31:01 +00:00
Julien Castiaux c0647b5c52 [REF] core: HTTPocalypse (14) changes all addons
This commit is the 14th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.

* `request.uid = x` => `request.update_env(user=x)`.
* `request.context = x` => `request.update_env(context=x)`.
* `request.context = dict(request.context, x=y)`
   => `request.update_context(x=y)`.
* `request.cr = None` => `request.cr.close()`.
* `http.mono_db()` => `request.db`.
* `http.dispatch_rpc()` => `service.dispatch_rpc()`.
* `@service.model.check` => `service.model.retrying()`.
* `request.endpoint`
   => `env['ir.http']._match(request.httprequest.path)[0].endpoint`.
* `request.routing_iteration `=> `removed`.
* `request.jsonrequest` => `request.dispatcher.jsonrequest`.

Note that `request.params` is now set much later in the process. If you
are in a situation where you values from the query string or the
http body you can use `request.get_http_params()`.

Note that using the new `request.future_response`, it is possible to
add headers and cookies on the response object before the response
object is initialized. Please note that headers/cookies saved on
the future response will NOT be injected in case of error.

PR: odoo#78857
Task: 2571224
2022-02-24 13:30:51 +00:00
Julien Castiaux f04b90b6e8 [REF] core: HTTPocalypse (12) web ir.http & login
This commit is the 12th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.

The web module is twofold, on one side there are many controllers: /,
/web, /web/login, /web/database/selector, /web/dataset/call_kw, etc, on
the other side there is `session_info`: the method responsible to create
the web client's environ.

This module is kinda an exception as it is (with base) a server wide
module. In the case of the HTTP framework, it means that the controllers
of web are always accessible, i.e. going to / or /web/login will never
return a 404 Not Found even if the user is not connected to a database.

This is both a blessing and a curse. It is a blessing because the
controllers are always accessible it means that a new users can freely
access those routes. It is a curse because *any* user can access them,
even user who don't have a session yet thus who are not connected to a
database yet. From a developer standpoint, we have to put extra care to
correct serve users with and without a database. An example is the
/web/login route, the login/password pair is stored in a database,
without database it is impossible to validate a user login but users can
still access this route without db.

To solve this problem, there is the `ensure_db` function. This function
attempts to find a database using various sources (?db= query-string,
session db, mono db) and to save it on the user session. In case no db
is found, the user is redirected to the database selector. In a way,
this function grants a database to the user in a seamingly experience.
In a way, this function brings a welcome differentiation between
`auth='none'` with a database and `auth='none'` without a database. Such
differentiation only matters for the server wide modules as "regular"
module controllers are only accessible via the ir.http routing map, i.e.
it is not possible to declare a nodb controller outside of server wide
modules.

An important changement is the `session.authenticate` method, before it
was possible to call the method when the cursor was not yet initialized,
authenticate would open a cursor against the given database, setup a
registry and an environment and ultimately save everything on the
current request. Because the cursor is now greedily created, it is no
more possible to update the request environment when authenticating on
another database.

PR: odoo#78857
Task: 2571224
2022-02-24 13:30:50 +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 5cea16ab7e [FIX] web: do not crash when attempting to consume a tour
Previously, when completing the last step of a tour by hand, the tour
manager attempts to make an RPC to consume the tour in the backend. This
used to crash with an error saying parent._trigger_up is not defined.
This was caused by the root.widget, which is the tour manager parent,
not being a real instance of ComponentAdapter, but an object created
with the ComponentAdapter as it's protorype. To give it access to
_trigger_up, it should be created with the ComponentAdapter's prototype
as its prototype, but this would still fail as it wouldn't have the
correct environment containing the rpc service.

The simple solution is to create a real instance of the ComponentAdapter
by hand. Although owl 2 does not support instanciating components by
hand and mounting them later, we will never mount this component or use
any of its owl features, we are simply using it to replace what used to
be the ServiceProvider in legacy.

closes odoo/odoo#85221

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 16:07:59 +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 030b1ba8d6 [REF] web: factorize some hotkey service code
- JS and DOM registrations are now shaped similarly,
  so this help to handle them with the same piece of code

- the keydown event object is now manipulated only in a single function,
  so it is clearer what it is used for and when it is eventually
  stopped or default prevented.

- some constants were converted from Sets to Arrays because they had
  no particular reason to be Sets.

closes odoo/odoo#84969

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-21 20:11:55 +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
Antoine Vandevenne (anv) adf70bf9dc [FIX] *: retarget documentation links to master
closes odoo/odoo#84990

X-original-commit: 39bdf46
Related: odoo/enterprise#24582
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-21 17:01:02 +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