Commit Graph
12136 Commits
Author SHA1 Message Date
Francois (fge) dca9ca6464 [IMP] web: refactor debug commands
Rename `Debug Menu` => `Debug tools...`
Remove `Debug tools...` hotkey

The commands in the debug category need to have a search value
to be displayed.

Task-id: 2622240
Part-of: odoo/odoo#74933
2021-08-26 13:56:14 +00:00
Francois (fge) 8b856c6699 [IMP] web: refactor command palette
This commit is a refactoring of the command palette. It aims to improve
its design and make it very easily configurable. For this, we added the
config props allowing the command palette to know what to display.

The config of a palette command is composed of:
- categoriesByNamespace?: list containing all categories according
  to their namespace;
- emptyMessageByNamespace?: dictionary having for key a namespace and
  for value the message to display if there is no choice available;
- footerTemplate?: template to display in the footer;
- namespace?: namespace to add in the search bar;
- placeholder?: placeholder of the searcher;
- providers: list containing all the providers generating the commands
  to display;
The providers are the only information needed in the config. The rest of
the config is optional.

This commit also adds the possibility to open a custom command palette
using the command service. For this, you just have to call openPalette
and give it the required config.

If the command action returns a config, the command palette  will
not be close and will use this new config.

Task-id: 2622240
Part-of: odoo/odoo#74933
2021-08-26 13:56:14 +00:00
Arnaud Joset 40fd44f618 [IMP] calendar,google_calendar,microsoft_calendar: Improve UI
Before this commit, the calendar UX was not good enough. The look and feel was not modern.
This commit improves a lot of small details, remove unneeded or not mature features (like the videocall location url).

Counted recurrence now brings a better experience. When weekly or montly recurrences are created, occurences in the past are dismissed but before this commit their number was not adapted.
User would end up with less occurences than the provided number without explanations.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:02 +00:00
Arnaud Joset 57dbfff2db [IMP] web: improve calendar view
Before this commit, the calendar filter was a little bit limited: you could add filters to only display events related to these filtered records or display all events.
If you wanted to select all active filters, we had to check all these individual filter.
This commit introduce the possibility to select all existing filter at once or to unselect them. It is quite convenient when a lot of filter are displayed but unchecked.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:00 +00:00
Arnaud Joset bb9f21d945 [IMP] calendar,google_calendar,google_calendar: allow modifying all event in recurrence
Before this commit, it was not possible to reapply all events in recurrence, delete all events of a recurrence or archive them.
This commit remove that limitation by reapplying the recurrence and remove all the existing events. When the events are synched, the action_mass_archive is used and it must ensure that only a request for the recurrency should be sent.
Individual request for each event are not sent.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:00 +00:00
Benoit Sociasandqsm-odoo f240a42ab5 [FIX] web: avoid freezing the browser when scrolling to undefined
Before this commit the browser did freeze if scrollTo(undefined) was
called. This happened because our "closestScrollable"'s jQuery addition
entered an infinite recursive exploration of .parent() elements starting
from $(undefined).

After this commit such wrong calls to scrollTo() will not freeze the
browser anymore but crash instead. The closestScrollable function was
also made more robust and return an empty element instead of looping.

task-2630257

X-original-commit: d1cda0f3ebb942ad58273db36692f28fa8a3b197
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-08-25 12:02:03 +00:00
Pierre Paridans 055b1eed65 [FIX] web: backport mobile OS detection support
This commit backports the mobile OS detection support, and specifically
Android & iOS one to allow more specific targeting of edge cases (i.e.
disabling native date picker in the mobile iOS app only).

opw-2613810

closes odoo/odoo#75577

X-original-commit: 7015dcd56566e93418f51e8e3562f384d10b4ffa
Related: odoo/enterprise#20446
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2021-08-25 11:37:41 +00:00
Leonardo Pavan Rocha 7e5b14c40f [IMP] sign: signature wizard behavior improvements
Improves overall signature wizard usage. Signature will adjust its size to best
fit the canvas, but maintaining its ratio.

task-2596079

closes odoo/odoo#73493

Related: odoo/enterprise#19577
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-16 12:49:53 +00:00
Jorge Pinna Puissant a81ba713ff [FIX] web: parse and format dates of mock server
On 00e3cb74c4 the migration of the code to
parse and formate dates on the mock server from moment to luxon was
done. Two issues were introduced on that commit: Parsing a date
displayed on quarter wasn't possible; And the ISO week year wasn't used
to format the date, but it was used to parse the date, for symmetry's
sake, now the ISO week year is used on both.

closes odoo/odoo#75354

Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2021-08-23 08:08:38 +00:00
qsm-odooandBenoit Socias a48a30f954 [IMP] website, web_editor, *: allow to use pre-configured gradients
*: web

After this commit pre-configured gradients can be used as snippet
backgrounds, snippet filters or as text effects / highlight effects.

The background colors (and now gradients) are now possible to add
*alongside* a color combination class (editing one does not remove the
other). Background colors and gradients are mutually exclusive.

Part of https://github.com/odoo/odoo/pull/73611
task-2599770

closes odoo/odoo#73611

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
2021-08-17 17:43:50 +00:00
Nicolas Lempereur 6943714f53 [FIX] web: pdf.js courier font ok with chrome 92
In new version of chrome (92) or firefox when some fonts (eg. courier)
were used:

- either the page would never finish loading (odoo 13 and below)
- or the text would in this font would not be shown (odoo 14 and over)

This was solved in pdf.js whith this commit:

https://github.com/mozilla/pdf.js/commit/8805614a03

And this PR is backporting that commit in 12.0 version up to master.

opw-2621405 opw-2613412 opw-2620186 opw-2618225 opw-2616690 opw-2615502
opw-2616249 opw-2615144 opw-2613969 opw-2613793 opw-2618129 opw-2617736
opw-2622506 opw-2614508 opw-2620883 opw-2622105 opw-2620863 opw-2615326
opw-2622842 opw-2620220 opw-2622842 opw-2620220 opw-2615346 opw-2615026
opw-2618389 opw-2619382 opw-2613286 opw-2621730 opw-2613412 opw-2622029
opw-2620625 opw-2622311

closes #75020

closes odoo/odoo#75057

X-original-commit: d3feb26c8923cfde60894058f06dc2c2a8be05f5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-08-13 01:29:08 +00:00
Mathieu Duckerts-Antoine a1f286916d [IMP] web: new ControlPanel class
We introduce here an incomplete implementation of the new ControlPanel.
The idea is to allow the rewritting of the client actions that do not
use the search view but only the breadcrumbs or the button zone...
The full implementation of the new ControlPanel will be merged when the
new search infrastructure is ready to be merged.

closes odoo/odoo#75083

Related: odoo/enterprise#20231
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-16 16:03:30 +00:00
Jorge Pinna PuissantandSamuel Degueldre 00e3cb74c4 [REF] web: migrate from moment to luxon
Migrate the code of parse and format dates of mock server from moment to
luxon.

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-08-16 14:56:34 +00:00
Aaron Bohy 6a59d0014e [REF] web: reorganize formatters and parsers
- fields/format.js has been renamed into fields/formatters.js
 - fields/parsers.js has been introduced
 - parsers and formatters from l10n/numbers have been moved to
   fields/parsers.js and fields/formatters.js
 - same for parseCurrency and formatCurrency, and they have been
   renamed into parse/formatMonetary
 - humanReadable option is now a boolean, no longer a function
 - formatPercentage implementation has been simplified thanks to
   that reorganization
 - tests have been reorganized accordingly
2021-08-16 14:56:16 +00:00
Aaron Bohy dc4bff826c [IMP] web: add some field formatters
Reintroduces a registry "formatters" that contains util functions for
formatting field values. Those formatters take the same parameters:
value, field, options.
2021-08-16 14:56:15 +00:00
Jorge Pinna PuissantandSamuel Degueldre b27ec4067a [IMP] web: mock routes/methods defined outside web
Add a registry on the mockServer to allow mocking routes/methods
defined outside web

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-08-16 14:56:15 +00:00
Aaron Bohy 24c643bc4f [IMP] web: migrate math helpers
We move some util functions from the legacy file math_utils.js to the
file arrays.js. Those funcions will be used in the new implementation of
the pivot view.
2021-08-16 12:53:51 +00:00
Mathieu Duckerts-Antoine b134c1e45e [REF] web: new view service API
We simplify and document the view service API.
2021-08-16 12:53:50 +00:00
Géry Debongnie 2ebddcc585 [REF] web: remove useless view_utils file
The helper json_node_to_xml won't be used outside of the legacy code.
2021-08-16 12:53:50 +00:00
Mathieu Duckerts-Antoine dd8bf39d2a [REF] web: legacy template name
We prepare the rewritting of the search components for the new weclient:
we rename some legacy templates to allow the new components to use the
natural template names.
2021-08-16 12:53:50 +00:00
Mathieu Duckerts-Antoine b626631241 [FIX] web: ConfirmationDialog size
Before this commit, the confirmation dialogs displayed by the new dialog
service had the size "modal-lg" (default set on the Dialog class).
We set their size to "modal-md".
2021-08-16 12:53:50 +00:00
Mathieu Duckerts-Antoine 2000b122d5 [IMP] web: default title for confirmation dialogs
The confirmation have now "Confirmation" as default title.
2021-08-16 12:52:15 +00:00
Habib (ayh) 44029495bc [IMP] base, account, *: simplify multi currency setup
Automatically activate `group_multi_currency` if there is more than one active currency,
deactivate it if there is only one active currency

retain sale/pos feature of activating group_product_pricelist
adapt tests accordingly

Task 2610735

closes odoo/odoo#74396

Related: odoo/enterprise#20106
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-08-13 14:50:44 +00:00
Francois (fge) ad87436a0f [IMP] web: fuzzysearch test
closes odoo/odoo#74769

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-13 08:58:23 +00:00
Munaf Khan ac34cb5938 [IMP] web,base: improve UI of no content helper in settings
Currently, empty screen of the settings is not very beautiful
without proper action helper and decoration. It displays only
'no record found' string when no setting is found for the
search string.

With this commit, we make the no content helper for the settings
consistent with other apps. It now displays empty folder and
proper helper message.

TaskID-2588387

closes odoo/odoo#74570

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-03 04:55:32 +00:00
Antoine Guenet 7ed3f3151a [IMP] mass_mailing, web, web_editor: remove scrollbar on iframe contents
Mass mailing form view currently has a scrollbar for the contents of the
editor, one for the form view itself, and one for the sidebar. In
consequence we can sometimes end up with three scrollbars side by side,
which is ugly and confusing.
This ensures the height of the iframe is always that of its contents so
there is no need for a scrollbar.

When inserting a new snippet we want to autoscroll to that snippet. That
is a complicated situation because the element we want to scroll is not
in the same document as the element we want to scroll _to_.
To address that situation, a new option is added to `scrollTo` so we can
pass it the element to scroll. It can then check if we are in the
aforementioned situation, in which case it can correct the scrolling and
apply it to the right element.
We use that option in mass_mailing to prevent the bug.

Task-2545445

closes #71511
2021-08-12 10:19:14 +00:00
Hardik PrajapatiandMohammed Shekha 15f7b50cf3 [FIX] web: make name field blank on 'Save & New'
Before this commit: when typing something on many2many_tags widget and clicking
on 'Create and Edit' from many2many_tags widget shows form dialog, now clicking
on the 'Save & new' button shows the old value in the name field instead of the
blank value it is because of default context passed, clicking 'Save & New' will
pass old context due to which name field will have old value, this will create
issue when there is unique name constraint, pressing 'Save & New' and then
again clicking 'Save & New' will raise constraint.

After this commit: clicking on the 'Save & new' button will shows the blank
value in the name field, to fix this issue, we removed 'default_name' key from
context.

TaskID-2323194

closes odoo/odoo#75052

X-original-commit: 6e33a4a073acd6d4dc64743d010a8d754ad8a2ff
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-08-12 16:11:36 +00:00
Michael Mattiello (mcm) 962e6947e2 [FIX] web: list error handlers on error handle
Before this commit, error handlers were listed at the start
of  the service and some handlers couldn't be found if they
are not in the registry when the service is started.
Now, they are listed when errors are handled.

closes odoo/odoo#75011

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-12 11:34:50 +00:00
Pierre Rousseau 21cafb0cee [FIX] web: mock active_test for search and search_read
The support for "active_test" context key was ignored in "search" and
"search_read" methods. See https://github.com/odoo/odoo/commit/bf0e3403098a9a36cb7c818388ccca1ea87682bd

closes odoo/odoo#75058

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-13 06:30:40 +00:00
Bruno Boi 670cc8cdc6 [FIX] web: avoid displaying empty dialog
BEFORE
If a dialog is destroyed while the dialog is being opened, an empty
modal is still displayed. This could arrive if its parent is destroyed
in this precise phase.

AFTER
The dialog checks if it has been destroyed right before being attached
to the DOM, so displaying an empty modal should not happen anymore.

Taskid-2461277

closes odoo/odoo#74175

X-original-commit: dbfff9079cccdf209cf4164c3722bc7baa1a16d3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
2021-08-12 14:12:41 +00:00
Aaron Bohy 5996e2003d [FIX] web: correctly position popover
Before this commit, the popover was a bit far from its target. We
use a margin to compensate the arrow size (8px), but we used it the
wrong way, meaning that instead of applying, e.g. a margin of -8px,
we applied a margin of 8px. As a consequence, popovers were always
positionned at 16px from their target.

closes odoo/odoo#74955

Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
2021-08-11 08:31:41 +00:00
Francois (fge) aa12e9853e [IMP] web: improved api of commands generated by a provider 2021-08-11 08:38:10 +00:00
Bruno Boi b28884161c [FIX] web: legacy dropdown position
Before this commit: the legacy dropdown menus are not placed properly

Issue introduced with commit odoo/odoo@0bb93b2

closes odoo/odoo#74947

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-11 07:01:36 +00:00
Nasreddin Boulif (bon) 1f37e4e0d6 [FIX] web: Allow array value for many2many search filter
Issue:

  In an action, if we add to the context a key `search_default_x_ids`
  (who is a many2many field) with an array of ids as value, it will
  display/use only the first value in the search bar.

Cause:

  If filter-type is 'field' and it's an array, it will take the first
  value.

Solution:

  Take first value of array only if field-type is a `many2one`.

Inspired by Odoo v13.0

opw-2596345

closes odoo/odoo#74936

X-original-commit: 1083bd204a10c9ec1708ba09e85d50fcba8ba8af
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-08-10 13:18:25 +00:00
Bruno Boi 0bb93b272c [FIX] web: various dropdown style issues
Various styling fixes.
Issues were brought by odoo/odoo@3b73095302

closes odoo/odoo#74752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-10 12:58:02 +00:00
imanie383 8679a0e431 [IMP] web: make menu adaptation customizable
the data dom:autoMoreMenu:adapt was added, so that the external
 code can update the menu directly when needed

closes odoo/odoo#74920

X-original-commit: 7283bc5b07ae489d3ece926e2860c26c3d891d59
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-10 10:58:58 +00:00
Adrien Widart 3b0c610b1c [FIX] web: get remaining days on a date field
When getting the remaining days before the deadline of an activity, the
module applies the TZ offset on the deadline date. This leads to
incorrect data.

To reproduce the error:
(Need crm)
1. Configure your computer:
    - TZ: America/Anchorage (UTC-8)
2. Log in DB
3. Ensure user's profile has the correct TZ
4. Create a lead
5. Schedule an activity A:
    - To Do
    - Due Date: tomorrow
6. CRM > Sales > My Activities

Error: The deadline of A is "Today" instead of "Tomorrow"

To get the days difference, the module computes the current date in
user's TZ. Then, it takes the deadline value and applies the offset
between UTC and user's TZ to this deadline value. Eventually, it
compares the two dates.

Here is the problem: the deadline is a date, not a datetime. As a
result, when applying the offset, if the user's TZ is a "negative" one
(UTC-...), it will change the date to the previous day.

For instance, suppose current date is 2021/08/06. In above use case, the
deadline is 2021/08/07. When comparing the dates, the deadline
(2021/08/07 00:00:00) becomes 2021/08/06 16:00:00 (because we are
UTC-8), thus the module will display "Today".

We shouldn't add any offset on a date field.

OPW-2448835

closes odoo/odoo#74858

X-original-commit: 549f0a11deb700dc6a65a3fbff94a889b9b1f278
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-08-09 11:26:51 +00:00
Mohammed Shekha 01c460f37a [IMP] mail: support many2many_avatar in kanban and list view
Purpose
The aim of the current task is to adapt the design of this new widget to the
list and kanban views.

SPECIFICATION

Kanban
when there is only one record set in the m2m field, display it like a
many2one_avatar widget when there are two or three records set in the m2m
field, display the avatars next to each other when there are more than three
records set in the m2m field, display the first two avatars, then a grey circle
with +X in it (where X is the number of records beyond the first two), when
hovering the +X avatar, open a tooltip with the list of the remaining records
the display order of the records is the same as the order in the m2m field
the avatars behave like in the other avatar widgets (i.e. darkens on hover and
clicking on it opens the chat) except the +X avatar that does not darken or has
a cursor:pointer; on hover and is not clickable

List
same specs as for the kanban view, with the difference that the widget displays
up to five records instead of three when the widget is editable display it like
the current formview version of the many2many_avatar_user widget (i.e. tags
with avatars)

task-2563591

closes odoo/odoo#72166

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-08-06 09:12:08 +00:00
Andrea Grazioso (agr-odoo)andMathieu Duckerts-Antoine 38bff3d7f5 [FIX] web: flip axis does not mess up groupbys
A traceback occurs after the following operations:

1. Go to Accounting-> Reporting-> Invoice Analysis
2. Open Pivot view
    (the pivot view is grouped by ["invoice_date"] (for rows) and by ["product_categ_id"] (for columns))
3. Click on "Flip Axis"
4. Select filter "Invoices"
5. Close row header "Total"

This happens because at some point `this.data.rowGroupBys` and `this.data.colGroupBys`
happen to point to the same object (they are both equal to the action group_by):

At step 2, rowGroupBys is set to be the action group_by (loading the model).
At step 3, colGroupBys is set to be rowGroupBys (and thus the action group_by).
At step 4, rowGroupBys is set to be the action group_by (reloading the model).

So that the step 5, just before the traceback, removes the group by "product_categ_id"
from `this.data.rowGroupBys` and thus `this.data.colGroupBys`.
This causes a problem when generating the pivot table.

The fix to that problem (and to some similar problems) consists
to never equalize `this.data.rowGroupBys` with some other fixed groupby
(action group_by here).

opw-2511057

closes odoo/odoo#74792

X-original-commit: 1e66fd9e9888e75d8952d8812458d806f05dcf8b
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Andrea Grazioso <agr@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-08-06 15:04:50 +00:00
Romeo Fragomeli c07f693550 [FIX] web: Hide "View Bookmark" button on PDF.js
The "View Bookmark" button is used to set URL parameter to be able
to jump to bookmark by copy pasting the generated link.

As there is no way to copy this, this feature is useless in our case.

closes odoo/odoo#74833

X-original-commit: 652461aed59aa97e48f0a8934316cdb846afd769
Related: odoo/enterprise#20131
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-08-06 16:29:10 +00:00
Aaron Bohy f6c57577fd [FIX] web: correctly put load_views rpc result in cache
In the "view" service, there is a cache s.t. we don't do the
load_views rpc each time we enter an act_window action. However,
before this commit, we never did cache hits because we modified
(in place) the "views" key inside the action, which is used to
generate the cache key.

closes odoo/odoo#74783

Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
2021-08-06 11:48:10 +00:00
Samuel Degueldre 64fc704527 [IMP] web: log module loading issues even when they throw a real error
Previously, when an Error was thrown inside an async module, that error
would not cause boot.js to log information about missing, failed or
rejected modules. This is because we were only using guardedCatch to
mark modules returning a rejected promise with something other than an
error as rejected, but the case where a real error was thrown was not
handled, which left the job to be forever pending.

This commit fixes that by catching real errors after the previous
processing, and treats it like an error in a synchronous module.
2021-08-06 10:15:23 +00:00
Adrien Dieudonne 9a445afffe [FIX] web: pdfjs: restore download button in attachment viewer
Due to the following PR: https://github.com/odoo/odoo/pull/70092
the download icon wasn't present in the document viewer.
We had to do this to avoid crash in mobile apps (Android and iOS).

But even if there are multiple other ways to download file, some
of our users are used to use pdf js download button that was previously
hidden.

So in this commit, we restore it on desktop as we can now correctly
handle the error on Android tablets and hide this button on iOS tablets.

Note that pdfjs button is not needed on mobile as we doesnt' have
attachements preview on small screens. Another button is available
when you open the file.

Steps to reproduce:
- Go to Accounting
- Customer Invoices
- After printing it once, the download icon wasn't present in pdfjs preview

closes odoo/odoo#74675

X-original-commit: 036c2475ac5c9ae3a0692486badfceb45de1f52b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-08-03 19:56:29 +00:00
Francois (fge) aaed3a73d4 [IMP] web: add debug command
This commit adds commands to enable/disable debug mode and to get
to the debug menu from the command palette.

closes odoo/odoo#74587

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-04 11:49:15 +00:00
Gorash 5913b7265e [REF] base,*: refactor Qweb engine
* Remove AST in favor of pure Pyhon. This should make it easier for
developers to understand and create new directives because they do not
need to know AST.

* Remove `t-call-options` as it has been merged into `t-options` for more
consistency. Support for t-call-options is retained.

* Use generators for lists. This increases performances as the rendering
can be sent directly without having to wait for the creation of the
entire list.

* Optimize expressions runtime computation by pre-computing the static
parts.
Example:
'<' + 'div' + '>' + '<' + dynamic_value + '>'
Now compiles as:
'<div><' + dynamic_value + '>'
2021-08-03 15:37:54 +00:00
Samuel Degueldre ce5599926a [REF] web, website: remove legacy DebugManager and use new DebugMenu
Previously, the debug manager was rewritten with the new webclient
architecture, however, because the frontend did not have access to the
new infrastructure (env and services), the old debug manager was kept
and used only in the frontend.

Since odoo/odoo#72675 the new env and services are now available, this
commit simply uses the new debug manager in the frontend and removes the
legacy code.

closes odoo/odoo#74609

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-03 14:03:18 +00:00
Nasreddin Boulif (bon) 69886e8275 [FIX] web: resize only target column in list view + test
Steps to reproduce:

  ! Chrome version >= 91.0.4472.114 (no issue on <= 90.0.4430.51)
  - Install Accounting module
  - Go to Customer Invoices and create a new one
  - Add a customer with a very long name, add product then save
  - Go back to list view
  - Ensure that the column "Customer" does not display the full
    customer name
  - Try to resize "Customer" column

Issue:

  All columns are resized.

Cause:

  Since Chrome 91.0.4472.114, `max-width` on column cause
  an issue with table.
  The issue is triggerd when a <th> width size
  exceeds the maxWidth size.
  Also, when resizing, the maxWidth of current collumn stays the same.

Solution:

  On resizing, update also, maxWidth with new width value.

opw-2585307

closes odoo/odoo#74649

X-original-commit: 0cc1a5863a1dee27ab5b8500c6de75628f1c441c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-08-03 15:18:29 +00:00
Simon Genin (ges) 888ff78c20 [REV] web: display issue with x2many list
This reverts commit 3190bbe8be9685bc936d92b9840d567be120b85c.

It introduced a bigger problem where the m2m table would have a width
of 0 and not be visible when switching page in the notebooks.

closes odoo/odoo#74619

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-03 10:58:25 +00:00
Bruno Boi b0b7469622 [FIX] web: home_menu navigation conflict
BEFORE: e.g. navigating with arrows in a dropdown menu when the home menu is showed conflicts (focused item changes in the same time in the dropdown and in the home menu)

AFTER: the home menu will not receive keydown events that are stopped by the hotkey service.

Taskid-2578926

closes odoo/odoo#73130

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-03 08:51:36 +00:00
Bruno Boi 3b73095302 [IMP] web: new dropdown design and keynav
As the dropdowns have been reworked in the new webclient framework, here
is an improved version of this preliminary design.

Implemented specs:
- nested dropdowns open themselves horizontally (at right by default)
- keyboard navigation is fully adapted to this new design
  - up/down focus previous/next item in opened menu
  - tab/shift+tab focus next/previous item in opened menu
  - home/end focus first/last item in opened menu
  - right/left open/close a sub dropdown
  - enter selects the focused item
  - escape closes the current dropdown
- add "loop" behaviour for keeping pressed down arrowup and arrowdown keys

Taskid-2578926
2021-08-03 08:51:36 +00:00