Commit Graph
14905 Commits
Author SHA1 Message Date
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
Aaron Bohy 290ddb3686 [IMP] web: tests: show dialogs when debugging a test
By default, dialogs are hidden in tests, s.t. we don't see them
flicker when running the test suite. There is a css rule to hide
them, only if there's no "debug" classname on the body.

This commit toggles this classname when a test is run with
QUnit.debug.

closes odoo/odoo#84694

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-02-16 11:30:50 +00:00
Pierre Paridans 48134b44d6 [FIX] web: don't show empty burger menu on mobile
When the current app doesn't provides menu-items (or the user doesn't
have the rights to access them), the mobile burger menu should fallback
to the user menu instead of an empty one (like on the App Switcher).

Steps to reproduce (on mobile):
- on a newly database, install only "notes" app
- connect as 'demo' user
- open the notes app
- open the burger menu
=> as there is no submenus, burger menu is empty.

task-2345001

closes odoo/odoo#84692

X-original-commit: odoo/enterprise@f8e85c39e6
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-16 11:30:43 +00:00
Achraf (abz) 6353fbaa06 [FIX] web: Allow user to groupby nonstored field
For the moment we cannot groupby an inherited field (which is therefore related) in a graph view, so it is counted as being non-stored.
Because in the `_normalize` function we do not process fields that are not stored, whereas like here

https://github.com/odoo/odoo/blob/d679cd0d8ba9a2420e81a42a698763e9be2327e1/addons/web/static/src/legacy/js /control_panel/groupby_menu.js#L45-L49.

Typically when a field has store=False but sortable=True it is inherited from a stored field, so it can be sortable
So we have to use `sortable` instead of `sort` to make it consistent.

opw-2733133

closes odoo/odoo#84612

X-original-commit: ce2a538e2988aef572171f783891cd6ee644ad14
Related: odoo/enterprise#24351
Signed-off-by: Achraf <abz@odoo.com>
2022-02-15 15:51:42 +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
Samuel Degueldre 07bbe4e8dc [IMP] test_lint, *: activate no-duplicate-imports eslint rule
*: base_automation, hr, mail, web, web_tour, website_payment

Previously, some modules were imported twice, this increases duplication
and can make refactoring more difficult. This commit enables the
no-duplicate-imports eslint rule and fixes offending modules to remove
duplicates.

closes odoo/odoo#84530

Related: odoo/enterprise#24319
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-15 09:26:54 +00:00
Samuel Degueldre 9b8f77caee [IMP] test_lint, web, point_of_sale: enable no-unsafe-negation rule
This commit also enables the valid-typeof rule which didn't find any
issues

Part-of: odoo/odoo#84530
2022-02-15 09:26:53 +00:00
Nasreddin Boulif (bon) 56e6c90e6d [FIX] web: display correct favicon depending company
Steps to reproduce:

 - Activate Debug mode
 - Go to Settings -> Companies
 - Create company A and B and set a different favicon for each company
 - Refresh the page or switch company

Issue:

  The favicon is not the right one.

Cause:

  Code (that update favicon) removed when refractoring of owl.
  Related commit: https://github.com/odoo/odoo/commit/0573acae2306bf5da2005852da9323ddc59e5431

Solution:

  When web client start, update in JS the favicons (desktop and mobiles)
  with current company favicon.

opw-2664525

closes odoo/odoo#84571

X-original-commit: fa2cc58ef34382a8b9a8d04a6e54267e39630432
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-02-15 08:34:05 +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
Martin Trigaux 9fbf706ba8 [I18N] *: export saas-15.2 translations
closes odoo/odoo#84475

X-original-commit: 8ea2605fbfec6277d7a01b6e73548a9585866c61
Related: odoo/enterprise#24289
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-14 10:44:50 +00:00
Mathieu Duckerts-Antoine 3e2229db20 [FIX] web: flickering in graph view
Chart.js did badly compute the graph canvas container height (width) by
using clientHeight (resp. clientWidth) that may be rounded up by the
browser. This leads to the appearence of a useless scrollbar in the
graph view and makes it flicker on some update.

closes odoo/odoo#84476

X-original-commit: 6bceae94619da9f4943cbc1e58844fdbe0215802
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-14 07:58:52 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
sofiagvaladze 41ad15b761 [FIX] web: fix the traceback
Problem occurs when we try to export report data and click
'I want to update data (import-compatible export)'.
We might end up exporting data when only field to export
is - External ID (id).

To reproduce an issue (for example):
Go to Time Off/Reporting/by Type; Remove filters from search.
Select couple records, then Action/Export.
On the wizard, click on 'I want to update data (import-compatible export)'.
Click on External ID from 'Available fields' to add it to 'Fields to export'.
Click export.

It gives traceback -
File "/data/build/odoo/addons/web/controllers/main.py", line 710,
 in write_header self.worksheet.set_column(0, i, 30) # around 220 pixels
UnboundLocalError: local variable 'i' referenced before assignment

task - 2687370

closes odoo/odoo#84191

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-02-11 13:21:02 +00:00
Pierre Paridans f6a9895d62 [IMP] web: move Burger Menu tests
Follow-up odoo/enterprise@3f78e5ade6

Standalone burger menu tests are moved to community, while we leave
other enterprise dependent tests in enterprise.

closes odoo/odoo#84406

Related: odoo/enterprise#24263
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-11 11:40:38 +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
Dossogne Bertrand 7e97f7c92d [FIX] web: fix settings boolean fields ux on mobile
closes odoo/odoo#84379

X-original-commit: 5c295fd1bc89c7d6978fa87af295282b30392e26
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-11 07:17:53 +00:00
Samuel Degueldre 89f6d64d06 [IMP] web: don't observe immutable objects in command palette
This improves rendering performance when there are a lot of command
items.

closes odoo/odoo#84303

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-10 10:49:43 +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
Géry Debongnie 966abc39b5 [REF] web: update owl to version 2.0.0
Changelog: https://github.com/odoo/owl/blob/a9f29c4caad4f32d06be1ec4780572825781cd9b/CHANGELOG.md
Part-of: odoo/odoo#80156
2022-02-10 07:46:12 +00:00
Bruno Boi 019bbef45d [FIX] web: ignore floating point imprecisions in position hook
Due to floating poing imprecisions, the position hook
overflow computations may be off under some hard to
predict circumstances.

This commit ceil all the compared parts in order
to have the same base of comparison.

closes odoo/odoo#82434

Related: odoo/enterprise#23337
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-09 13:47:20 +00:00
stefanorigano (SRI) ad64f56f6f [FIX] web, mail: systray 'disabled' state vs 'no-notification' design
Prior to this commit the 'disabled' state (eg. studio icon in a
not-editable view) and the 'no-notification' state (eg. messaging icon
without badge) shared the same design.

While the disabled state should be used for not-clickable elements only,
available systray items should always appear clickable, even
when there are no new notifications.

This commit moves the `o_disabled` class outside the burger_menu
component, making it generic and available for other components too.

Systray items without notification are now styled normally.
The simple presence of the badge communicates the user that a new
notification has been sent.

This commit is part of v16 overall restyle (task-2704984).

task-2712151

Part-of: odoo/odoo#82434
2022-02-09 13:47:20 +00:00
stefanorigano (SRI) 244571b4b4 [FIX] web: debug profiling menu design
This commit fixes the profiling menu item design, simplify the css and
removes several lines of vendor-prefix animations no longer necessary.
This commit is part of v16 overall restyle (task-2704984).

task-2712151

Part-of: odoo/odoo#82434
2022-02-09 13:47:19 +00:00
stefanorigano (SRI) 3acbc54709 [MOV] web, website: move navbar-mobile logic to website
Since the framework's navbar uses the hamburger_menu in community too,
the `navbar_mobile.scss` code initially shared between frontend and
backend is now needed for the frontend only.

This commit is part of v16 overall restyle (task-2704984).

task-2712151

Part-of: odoo/odoo#82434
2022-02-09 13:47:19 +00:00
stefanorigano (SRI) 60fadfeaf6 [REF] web, mail, website: responsive navbar design
Prior to this commit the topbar responsiveness was exclusive to
enterprise.

This commit moves to community the mobile logic for navbar, burgermenu,
user_menu and company_switcher.

The design has been adapted to v16, reviewing font size/colors and
icons. This commit is part of v16 overall restyle (task-2704984).

task-2712151

Part-of: odoo/odoo#82434
2022-02-09 13:47:19 +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
stefanorigano (SRI) 546477dafa [ADD] web: .oi, odoo ui icons
This commit introduces our own icons meant to be extended over time and
to coexist with FontAwesome 4.7.

The goal is to provide a wider range of icons specifically made for our
UI and cover FontAwesome's lack of iconography for specific businesses
and functionalities.

Classes' names are available in our documentation website and the SVG
source files can be found in our `design-assets` repo.

This new bundle mirrors fontAwesome architecture; icons are rendered
applying classes to standard HTML flow-tags (normally an `<i>`), eg:

`<i class="oi oi-odoo"/>`

This implementation applies size and alignment rules directly to the
`:before` pseudo-element rather than to the class itself. The aim is to
prevent misalignment when icon classes are applied to buttons and other
UI elements, eg:

`<button class="btn btn-success oi oi-arrow--right"/>`

Note: Despite being technically feasible, this approach is highly
discouraged and should be avoided.

This commit also introduces utility-classes specifically made for
our UI. In detail:

- Fours sizes: '.oi-small', '.oi-normal', '.oi-large', '.oi-larger'

  Relative to the parent font-size, these classes cover a range from
  `0.8em` to `1.77em`. Each size has been designed to match our default
  text-fonts in the attempt to compensate font-icons common alignment
  issues (https://css-tricks.com/icon-fonts-vs-svg/#aa-positioning ).

- Responsive classes: `.oi-[screen]-[icon_size]`

  Responsive classes mirror Bootstrap ones and can be combined to
  achieve different size results at specific resolutions, eg:

  `<i class="oi oi-studio oi-larger oi-md-normal oi-lg-small"/>`

- Fixed width: '.oi-fw'

  Mirrors FontAwesome 'fa-fw' by setting icons at a fixed width.
  Our implementation adapts according to size and responsive classes.

- Animations: '.oi-spin', '.oi-pulse'

  Mirrors FontAwesome default animations.

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
stefanorigano (SRI) 04f74c0d7f [REF] web: optimize font-awesome
This commit reduces fontAwesome footprint by removing legacy font-files
(~750kb). It keeps WOFF(s) formats for browsers and TTF format for PDF
and ICON to PNG generations.

TTF format has been removed from the CSS [@]fontface rule, but it's
still called directly in python when needed[1].

This commit reviews the CSS too, removing obsolete vendor-prefix rules
and discontinued fontAwesome classes.

Part of v16 overall restyle (task-2704984).

task-2745275

[1] https://github.com/odoo/odoo/blob/15.0/addons/web_editor/controllers/main.py#L45

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00
stefanorigano (SRI) 0f64e506f2 [MOV] web, * : move font-awesome library in an editable location
This commit "forks" fontAwesome into `src/libs` in order to allow
further customization.
Part of v16 overall restyle (task-2704984).

task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00
stefanorigano (SRI) 4a5dbf6a57 [FIX] web, *: float utility-classes
'pull-[left/right]' classes are discontinued since Bootstrap v3 [1].
The reason why we never noticed is that we were unknowingly
relying on fontAwesome utility classes that are basically the same.

Since v3 we were supposed to use 'float-[left/right]' classes [2], but
these classes will be renamed again in v5 with 'float-[start/end]'[3].

This commit introduces "v5 ready" utility-classes and replaces v2 legacy
occurrences across the UI.
These classes definitions can be safely removed when v5 migration will
be completed.

Notes:
- this commit will *not* adapt frontend occurrences since its CSS
  already relies on a "migration table" [4]. 
- this commit will *not* adapt the few v3 'float-[left/right]'
  occurrences since are supposed to be handled in the v5 migration
  task (task-2704984).

This commit is part of v16 overall restyle (task-2704984).

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

[1] https://getbootstrap.com/docs/4.3/migration/#utilities
[2] https://getbootstrap.com/docs/4.3/utilities/float/#classes
[3] https://getbootstrap.com/docs/5.1/utilities/float/#overview
[4] https://github.com/odoo/odoo/blob/15.0/addons/website/static/src/scss/compatibility/bs3_for_12_0.scss#L49

Part-of: odoo/odoo#83501
2022-02-08 12:05:53 +00:00
Benoit Socias 96d2016cf6 [FIX] web, website: allow scrolling when only cookies bar remains
Since [1] when web was migrated to OWL, the cookies bar was considered
as a parent modal of any openend modal that got closed - thus preventing
scrolling the full page.

After this commit the cookies bar in the front end is not considered as
a remaining modal anymore, and therefore does not prevent scrolling on
the currently displayed website page.

[1]: https://github.com/odoo/odoo/commit/29731b404fe624b733d784cd4321113d6b0d27b7

task-2741894

closes odoo/odoo#84128

X-original-commit: c1aab97e6b4e8b916c7d79db5f278c746fd6b119
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-07 19:04:00 +00:00
Victor Feyens 64aceb8914 [IMP] web: add test to cover recent change in framework
See 79f7c233ec

closes odoo/odoo#84011

X-original-commit: c5d8bb8ba0870d2b6fb00c57846ab8da7092398a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-07 10:07:53 +00:00
Nicolas (vin) c915373920 [FIX] web: BasicModel: contexts order
When combining the context for an RPC, the
additional context is being added before the raw
context.

Because of this, a use case such as:
   - A o2m field with a context {'field': 'a'}
     with a tree editable view below it
   - That view defines controls to create lines,
     which would change the context key 'field' to
     another value.
=> The field context key would take precedence on
the creates key, making it impossible to override
that key in specific circumstances.

closes odoo/odoo#83996

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-07 10:07:50 +00:00
Adrien Widart 30f4a40e20 [FIX] web: compute aggregate value with valid data
The footer of some lists may contain undesirable values (such as `NaN`)

To reproduce the issue:
1. Install mrp with demo data
2. In Settings, enable "Work Orders"
3. Open the list view of MOs
4. Group by product

Error: The total value for Expected Duration and Real Duration is
`NaN:NaN`

(The below explanation is about Expected Duration
(`production_duration_expected`). This is exactly the same behavior for
Real Duration)

As defined on the list view, if there are several rows on the list,
there must be a sum of all `production_duration_expected`:
https://github.com/odoo/odoo/blob/cddbb76e02c3848819ac1f06948b4e7ab8df4bdd/addons/mrp/views/mrp_production_views.xml#L35
This is correctly working when consulting a standard list of MOs (step
3). However, this is different when using the Group-By feature.

When rendering the list, at some point, `_computeColumnAggregates` is
called to compute the sum of all `production_duration_expected`:
https://github.com/odoo/odoo/blob/4e213f0b93f59cf377271b18eae9765ff9cfbe4f/addons/web/static/src/legacy/js/views/list/list_renderer.js#L178-L185
Here is the issue: the rows in the list `data` are not records (there
are results of `read_group`) and these rows don't have any aggregate
value for `production_duration_expected`, which means that
`d.aggregateValues[attrs.name]` returns `undefined`. As a result, when
performing the sum of `0` and `undefined`, it gives `NaN`.

Some detailed explanations:
`aggregateValues` is completed when processing the result of the
`read_group` RPC:
https://github.com/odoo/odoo/blob/bc79a329a1e1edf964f97886943c0688db2087fd/addons/web/static/src/legacy/js/views/basic/basic_model.js#L4697-L4703
However, on PY-side, `read_group` doesn't provide any value for
`production_duration_expected`. For a `read_group` to provide some
aggregate values, it needs the field to be stored and the
`group_operator` attribute to be defined on this field:
https://github.com/odoo/odoo/blob/5691b126f06c2b200ae507bd6edd8f8f7e68d5f5/odoo/models.py#L2521-L2528
Except that none of the conditions are met:
https://github.com/odoo/odoo/blob/d584ad282178deb40bb036c48f971617b0a41f88/addons/mrp/models/mrp_production.py#L147

OPW-2735181

closes odoo/odoo#84035

X-original-commit: 8bc1c582b626aedb680d59f858c92db9dfe4f357
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-02-07 09:07:00 +00:00
Paolo (pgi) ee324e8374 [FIX] web, l10n_ch: Error Correction Level QR Bill
l10n_ch QR bill report needs level 'M' (15% red.)
instead of default level 'L' (7% red.) as per:

https://en.wikipedia.org/wiki/QR_code#Error_correction

See specifications at:

https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-en.pdf

The layout of higher level of Error Correction
are made of a thicker grid with more squares
(more information) at the cost of them being smaller
(a little harder to be read by the scanner).

opw-2584899

closes odoo/odoo#82932

X-original-commit: 0f374b61a6f3b25a1f986afe455c0e42797a5769
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2022-02-04 19:44:38 +00:00
std-odoo d44e591ca9 [IMP] web: use Yes/No instead of True/False in views when grouping
Purpose
=======
When we group the record based on a boolean fields, we want to show
"Yes/No" instead of "True/False".

This has been done for the list view, the pivot view and the kanban
view.

Task-2648390

Part-of: odoo/odoo#79911
2022-02-04 09:28:12 +00:00
std-odoo eddef06ad4 [IMP] web: use Yes/No instead of True/False for the custom filters
Purpose
=======
"True" and "False" are not very user-friendly, especially for
non-technical people. Instead, we want to have "Yes" or "No" for the
custom filters, when we search on a view, which have more sens for
non-technical people.

Task-2648390

Part-of: odoo/odoo#79911
2022-02-04 09:28:11 +00:00
stefanorigano (SRI) da5d9e745f [REF] mail: o_Activity, revamp scss
Review and simplify activities SCSS.
Part of the overall v16 SCSS optimization/restyle (task-2704984).

task-2731819

Part-of: odoo/odoo#82590
2022-02-03 17:07:59 +00:00
Gorash e830953570 [IMP] IrQweb: refactoring and add technical documentation
Major changes:
- Remove some of the recursively when compiling
- Compile attributes became a directive
- Compile options became a directive
- `t-field` compilation now uses the same logic as `t-out`
- Simplification of ``t-if`` directive compilation
- Improved handling of errors wrapped by QWebException
- Constants defined outside the class

    Odoo
     ┗━► _render (returns MarkupSafe)
        ┗━► _compile (returns function)                                        ◄━━━━━━━━━━┓
           ┗━► _compile_node (returns code string array)                       ◄━━━━━━━━┓ ┃
              ┃  (skip the current node if found t-qweb-skip)                           ┃ ┃
              ┃  (add technical directives: t-tag-open, t-tag-close, t-inner-content)   ┃ ┃
              ┃                                                                         ┃ ┃
              ┣━► _directives_eval_order (defined directive order)                      ┃ ┃
              ┣━► _compile_directives (loop)    Consume all remaining directives ◄━━━┓  ┃ ┃
              ┃  ┃                              (e.g.: to change the indentation)    ┃  ┃ ┃
              ┃  ┣━► _compile_directive                                              ┃  ┃ ┃
              ┃  ┃    ┗━► t-if            ━━► _compile_directive_if                 ━┫  ┃ ┃
              ┃  ┃    ┗━► t-foreach       ━━► _compile_directive_foreach            ━┛  ┃ ┃
              ┃  ┃    ┗━► t-inner-content ━━► _compile_directive_inner_content ◄━━━━━┓ ━┛ ┃
              ┃  ┃    ┗━► t-options       ━━► _compile_directive_options             ┃    ┃
              ┃  ┃    ┗━► t-call          ━━► _compile_directive_call               ━┫ ━━━┛
              ┃  ┃    ┗━► t-att           ━━► _compile_directive_att                 ┃
              ┃  ┃    ┗━► t-tag-open      ━━► _compile_directive_open          ◄━━┓  ┃
              ┃  ┃    ┗━► t-tag-close     ━━► _compile_directive_close         ◄━━┫  ┃
              ┃  ┃    ┗━► t-out           ━━► _compile_directive_out             ━┛ ━┫ ◄━━┓
              ┃  ┃    ┗━► t-field         ━━► _compile_directive_field               ┃   ━┫
              ┃  ┃    ┗━► t-esc           ━━► _compile_directive_esc                 ┃   ━┛
              ┃  ┃    ┗━► t-*             ━━► ...                                    ┃
              ┃  ┃                                                                   ┃
              ┗━━┻━► _compile_static_node                                           ━┛

closes odoo/odoo#81024

Related: odoo/enterprise#22942
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-03 08:09:31 +00:00
Aaron Bohy f16278cd29 [IMP] web: boot: do not wait 5s to log module info
Since [1], the test suite waits for 5s to start running. It's
really annoying when you run the suite in your browser, to debug
a single test or a sub suite. Waiting for 5s to determine whether
all modules can be loaded or not is not necessary anymore since
all assets coming from the same bundle are loaded in a single
file, even in debug=assets. This is true under the assumption that
there's no js module in assets_common requiring a module in another
assets bundle, which seems reasonnable.

[1] 468eb84fb4

closes odoo/odoo#83805

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-02-02 09:03:55 +00:00
Sébastien Geelen (sge) 26bbac2b61 [FIX] web_editor, project: better field html sizing
Allow wysiwyg field html to blend better in odoo view,
Remove the default resizer and make the field html's size
automatically fit its content

task-2637488

# Conflicts:
#	addons/project/static/src/js/project_form.js

Part-of: odoo/odoo#83792
2022-02-02 09:03:44 +00:00
Sébastien Geelen (sge) 14f4bd526a [FIX] web_editor: adjust codeview button placement
Move the codeview button to avoid conflict with the Translate button.

task-2637488

Part-of: odoo/odoo#83792
2022-02-02 09:03:43 +00:00
Victor Feyens 79f7c233ec [FIX] web: do not send unmodified data to the server on record save
Following recent conversion of onchanges to computes in the sale scope,
it was observed that updating one line triggered price recomputation in other
lines (which isn't expected).

After investigation, it seems that the `product_packaging_id` field is considered
modified and sent on SO save for all the lines, which triggers the `product_uom_qty`
record computation, then the whole price computation is triggered, since it depends
on that quantity field.

This commit aims to fix this case by only considering a m2o field as modified
if its value was effectively changed.

closes odoo/odoo#83252

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-01 18:06:54 +00:00
stefanorigano (SRI) 035df6293b [ADD] web: opacity utility classes
Add new utility classes to handle basic opacity behaviors.
Once migrate to BTS5 these classes should be generated using the
upcoming utility classes API.

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2731819

Part-of: odoo/odoo#83108
2022-02-01 12:45:05 +00:00
Samuel Degueldre ad171e10f0 [FIX] web, website_livechat: fix embedable chat on external websites
Recently, a lot of the network infrastructure code was rewritten. A lot
of this new code doesn't account for the possibility of being on an
external website, and so network requests made with relative URLs would
not make their request to the odoo server but to the server serving the
external page which would fail.

This commit fixes that by replacing the regular rpc service with one
that will add the correct prefix, as well as patching the
"browser.fetch" method to do the same. Additionally, the localization
service is now less fault-tolerant, and won't silently fall back to a
default configuration if it cannot get the translations from the server,
as such, the tranlsations route is made available cross-origin, which
has the added bonus of making translations available to the embeded
code.

opw-2677184

closes odoo/odoo#83690

X-original-commit: 5ec64d15197e8d6cc7b115aeaca99aa49de0f151
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-02-01 07:11:27 +00:00
Kartik Chavda a7fb497435 [IMP] web: add new option format_type for daterange widget
Purpose of this commit to add format_type option in daterange
widget.

So, In this add format_type option in nodeoption which convert
actual formatType to given format_type in option and add test
case for that feature.

task:2710539

Closes: #81630
Related: odoo/enterprise#22994
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-31 19:25:48 +00:00
Benoit Socias daf5963845 [FIX] web, website: rely on hotkey_service for hotkeys in website
Since [1] when web's owl services were made available to the frontend,
the navigation mixin does conflict with the hotkey service.
E.g.: navigation mixin consumes the 'alt' keyup event, which prevents
the hotkey service from cleaning up the hotkey overlay.

After this commit the old mixin is neutralized and hotkeys in website's
pseudo-backend layer are handled by the general hotkey service.
Also since [2] the menu items are inside `<div>` instead of `<li>`,
adapted the scss to take this into account.
Also added a CSS rule to neutralize the outline on website's menu
dropdowns which are `<a>` instead of the already handled `<button>` in
web.

[1]: https://github.com/odoo/odoo/commit/db7b485d984e50fae5a52308634166460e5fc908
[2]: https://github.com/odoo/odoo/commit/84715436d87bb05b421bc9ccaacda67d07571690

task-2738578

closes odoo/odoo#83529

X-original-commit: 88438fa9b363530aa4e5dec5599c1568fb7ccea0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-01-27 18:51:49 +00:00
tranngocson1996 42b0799ed3 [FIX] web: fix avatar ratio
In the calendar UI, the avatars ratio has been edited differently with
the original

closes odoo/odoo#83494

X-original-commit: 81875cf0d0b2db5e2b2e0e70178d5ea04bdd509b
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-01-27 16:17:24 +00:00
Mathieu Duckerts-Antoine 795ccdf923 [IMP] web: remove component ref
OWL-2 is in preparation and will be soon merged. One of the changes it
will bring is that it will be no longer possible to use the directive
t-ref on a tag component. Here we refactor the code in order to remove
two uses of such t-refs.

closes odoo/odoo#81984

Related: odoo/enterprise#23464
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-27 16:16:57 +00:00
Mathieu Duckerts-Antoine afb4959c3e [REF] web: action service: historyBack
OWL-2 is in preparation and will be soon merged. One of the changes it
will bring is that it will be no longer possible to use the directive
t-on on a tag component. Here we refactor the code in order to remove
one use of it in the action service.

Part-of: odoo/odoo#81984
2022-01-27 16:16:56 +00:00