Commit Graph
622 Commits
Author SHA1 Message Date
Aaron Bohy b2e267872f [REM] web: remove legacy views benchmark page
Those views are no longer used and about to be removed. This
commit also removes the benchmark lib as it is no longer used.

Part of task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:57 +01:00
Jorge Pinna Puissant 9e14de9491 [FIX] web: update moment.js to 2.19.3
This version of moment.js is required to avoid CVE-2017-18214

task-2291793

closes odoo/odoo#112079

X-original-commit: 11f3e7351a899848ec4df0107c3f6e2a627807ba
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-02-07 13:34:50 +01:00
Stefan-Calin Crainiciuc (stcc) 0187c8a466 [FIX] web: pyjs: Tokenize float numbers in scientific notation
Steps to reproduce:

- Install Dashboard, Inventory apps
- Go to Inventory > Products
- Add a custom filter "Quantity on hand > 0.00001"
- Favorites > Add to my dashboard > Add
- Go to dashboard app

Issue:
JS Traceback is raised: `Expected "]", got "(name)"`

When executing the rpc call to `/board/add_to_dashboard`, the number
`0.00001`, which is passed as argument, is decoded as `1e-05` in the
python code and stored in the custom view.

When parsing the same view in the frontend, the tokenizer fails to
detect `1e-05` as a floating number and an error is thrown while parsing.

Solution:
Add regex for floating point numbers in scientific notation in `py.js`.
The regex accepts numbers such as:
- 1.2
- 12.
- .1
- 1e-02
- 1.2E-2
- 12.e+2
- .1E3

opw-3038707

closes odoo/odoo#111664

X-original-commit: d2d23e517fb81ab3779f6f0dbf0d035544c863d8
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2023-02-03 05:09:35 +01:00
Aaron Bohy 3844833a74 [FIX] web: update owl from 2.0.4 to 2.0.5
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.5

 - [FIX] reactivity: improve performance for long-lived reactives

closes odoo/odoo#111281

X-original-commit: 807ce931f56200d6f5fbde11605336750caf5465
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-28 09:41:55 +01:00
Aaron Bohy adad3f06ed [FIX] web: update owl from 2.0.3 to 2.0.4
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.4

 - [IMP] app: expose live apps for the devtools
 - [FIX] compiler: support t-model radio group in t-foreach
 - [IMP] runtime: improve useExternalListener typing

closes odoo/odoo#110790

X-original-commit: f7192699aea443bea278a55e0e383e59d98394c5
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-24 10:20:56 +01:00
Samuel Degueldre ae1cd3d5bb [FIX] web: update jQuery to 3.6.3
This version of jQuery fixes a number of bugs in jQuery compared to
3.3.1

Some legacy list tests related to the handle widget have been skipped,
we consider this acceptable because:
- there are no remaining uses of the handle widget in a legacy list view
in the code base. The only remaining usage of the legacy list view is in
the SelectCreateDialog legacy, which is only used in our code base by
the very few legacy client actions that will be converted before v17
- the tests are only broken in enterprise, and the widget appears to
work fine in practice, suggesting a problem with the way tests drag and
drop rather than an actual problem with the code
- spending time to debug tests that will be obsolete within the next few
months and also appear to not correlate to an actual breakage of the
functionality is not worth it.

task-2291793

closes odoo/odoo#106960

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 16:01:21 +01:00
Aaron Bohy 020ef1a694 [FIX] web: update owl from 2.0.2 to 2.0.3
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.3

- fix: compiler: correctly escape backslashes when emitting block string
- fix: reactivity: don't subscribe to keys when making reactive
- fix: t-call-context: fix capture making component available in ctx
- fix: t-call-context: make `this` unavailable in rendering context

X-original-commit: 90e913172053bdecc89aceced8c490eba2490013
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Bruno Boi ff619c4761 [FIX] web: repair keynav in dropdowns
- Before this commit
Keyboard navigation in dropdowns lead to a traceback

- Explanation
The traceback happens in the bootstrap library.
When upgrading to bootstrap v5.1.3 (see c48f57e), a fix done in the
previous bootstrap version was lost (see 78f85f2).
This previous fix also added a test but it was not enough to
detect the issue when the bootstrap lib was upgraded.

- After this commit
This commit reintroduce the same previous fix and adapts the test,
hoping it would be enough for future changes to not break further
the expected behavior.

closes odoo/odoo#108080

X-original-commit: daca8fe4e3da4a5ad5fabf3730496a3919af8abc
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-12-15 15:45:18 +01:00
niyasraphy 9a976a8c9a [FIX] various: uniquify the the !
Just change double the by single. This fixes various typos in error and
code comments.

closes odoo/odoo#107266

X-original-commit: 09dfedfc19c2bc34c2bb394dcc4bc609c5ac0107
Related: odoo/enterprise#34681
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 10:52:50 +01:00
Bruno Boi 66f60540c6 [IMP] web: update owl from 2.0.1 to 2.0.2
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.2

- fix: compiler: do not look up ComponentNode in the context
- fix: t-model takes precedence over t-on-input
- fix: reactivity: fix issues with reactive objects in proto chain

closes odoo/odoo#106898

X-original-commit: a86a8544883aaaf5d530320c84706dde35d17ef6
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-11-30 19:05:56 +01:00
Géry Debongnie 03cdc9c417 [IMP] web: prevent duplicate entries in QUnit dropdown search
It is really annoying to have thousands of duplicate entries in that
dropdown menu. This commit hacks the problem away, but modifying QUnit
in place. Some day, we should modernize our testing infrastructure, but
this will do the trick in the mean time.

closes odoo/odoo#105483

Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-11-10 12:22:05 +01:00
Joseph Caburnay d650ab6a9b [IMP] web,im_livechat: introduce @odoo/owl module
This is done so that using owl features and functions is done using
the standard import syntax, instead of destructuring properties out
of the owl global object.

So instead of just:

`const { Component } = owl;`

inside an odoo-module, we now do:

`import { Component } from "@odoo/owl";`

Note that we haven't removed the global `owl` object so existing
code will work as is.

Furthermore, we also augmented the tsconfig.json that's generated
from the tsconfig subcommand to take into account the path
of owl.js.

Task-id: 3032274
Part-of: odoo/odoo#104260
2022-10-27 14:41:17 +02:00
Xavier Morel 59442f0988 [IMP] web: open external links of PDFs in new tab
Reimplementation of 74fa91e0b3 on top of
new version of pdfjs. See previous commit for explanation.

Ideally we would set that behaviour from the outside using
e.g. `PDFViewerApplicationOptions.set` but there are multiple
locations from which we embed the viewer, which makes that a difficult
proposition. There should probably be a clean component which handles
loading the library, configuring it to our specifications (possibly on
a per-embed basis), and exposing both manipulations methods and events
which pdfjs triggers on its eventBus.

Part-of: odoo/odoo#100067
2022-10-26 09:07:34 +02:00
Xavier Morel 55d9f318fb [IMP] web: update pdfjs to 2.16.105
Our current version is getting rather outdated. Replace by
the *legacy* bundle: pdfjs now provides a non-polyfilled version of
the library, which is probably faster though it doesn't save overly
much (for the entire bundle anyway). Use polyfilled version for
safety, though it's unclear whether non-chromium Edge is still
supported by Odoo. If not, we could just use the non-polyfilled
version.

The difference is quite large for pdf.js (+32.5%), however it is much
less consequential for the sandbox (+1%) or for the much larger
worker (+5.6%). The biggest difference is likely performances
but... who knows?

Notes:

- The main reason for this change is that automated vulnerability
  scanner have apparently started scanning for `postMessage(..., '*')`
  and the previous bundles includes a version of corejs polyfills
  without zloirock/core-js#542), therefore triggering those scans. As
  the PR notes this is almost certainly not a concern because of the
  innocuous payload, but there is no reason to waste time on those
  reports if we don't *have* to.
- The bundle now includes "standard fonts", those were removed as
  they're heavy and may not be necessary for our usage (?).
- All the bitmap images were dropped and replaced by svgs, which is
  nice.
- The local changes since the previous update were *not* impacted in
  this, the entire thing was just reset to upstream. This means
  changes which were backported (922c7c72, 6943714f) are superseded
  but more odoo-specific changes will have to be reapplied in further
  commits.

Part-of: odoo/odoo#100067
2022-10-26 09:07:34 +02:00
Bruno Boi c964462774 [IMP] web: update owl from 2.0.0-beta-22 to 2.0.1
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.1

- fix: runtime: correctly throw an error for duplicate object keys
- fix: parser: give t-set-slot="default" priority over the content
- fix: blockdom: correctly reorder children in heterogeneous t-foreach
- fix: portal: correctly move portal content when target is after it
- fix: blockdom: fix event_catcher traceback when a parent component has an empty child

closes odoo/odoo#103847

X-original-commit: be996cf423ce09be4e4661c0b42a97d92a4dcdb4
Related: odoo/enterprise#33097
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-21 23:13:48 +02:00
Mathieu Duckerts-Antoine 6aac153473 [FIX] web: py.js: offset in to_utc
Take a (py.extras) datetime representing the moment "2022-10-17 00:00:00"
in the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or datetime, so that in
October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103579

X-original-commit: ee1a8d26f241f2f7bea6880afcc946119b0e6bd8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 20:47:54 +02:00
Brieuc-brd 51b51c04a8 [IMP] web: select2 : redefine and adapt colors
Prior to this commit, there was no common custom file to easily handle
select2 color values (e.g., dark mode).

This commit fixes this issue by redefining the values in webclient.scss.

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:55 +02:00
stefanorigano (SRI) 5234fad374 [IMP] web, base: adapt for dark-mode
This commit adapts several components in order to correctly handle
color-scheme variations.

It also allows user_menu to handle switch entries 

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:53 +02:00
Géry Debongnie 9567b27e0e [IMP] web: update owl from 2.0.0-beta-21 to 2.0.0-beta-22
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.0-beta-22

- fix: t-call: nested t-call with magic variable 0
- fix: prevent crash in case with t-foreach, t-out and components

closes odoo/odoo#101621

X-original-commit: 8a63aa3e81e32c7447351b1e657b24d8a5f33107
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-10-03 08:59:44 +02:00
Géry Debongnie 0cd2a8e1fe [IMP] web: update owl from 2.0.0-beta-20 to 2.0.0-beta-21
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-21

Details:

- fix: prevent side effects at template compilation
- fix: props validation: does not crash with t-call-context
- fix: make t-portal work in all cases
- fix: make props validation work through slots

closes odoo/odoo#101207

X-original-commit: a09733b8d60ba36327695657221304ef19eaed42
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-09-27 08:12:51 +02:00
Gorash ed2b117f5b [IMP] web: Added log information to help fix errors from services.
A typo fix is added.
Fix error from loading xml while widget is destroyed. Now that the xml
templates are loaded in the bundle, the error appears more frequently.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Samuel Degueldre 3db59860cb [IMP] web: display full tracebacks for error chains
Since owl now uses error chains/causes when errors happen in the owl
lifecycle, when an error happens in the owl lifecycle, the displayed
tracebacks generally only contain the stack trace of where owl called
the corresponding lifecycle hook.

This commit modifies the error service and the error utils so that now,
when completing/annotating a traceback, we also add the tracebacks
(annotated when appropriate) of the error cause chain, as it contains
valuable debugging information.

This commit also makes it so that the QUnit suite logs the source of
each test failure (which may be an error with a chained stack trace)

closes odoo/odoo#98157

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-09-12 13:48:49 +02:00
Samuel Degueldre 0582819b10 [IMP] web: update owl from 2.0.0-beta-19 to 2.0.0-beta-20
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-20

Details:
- imp: app: properly rethrow unhandled errors

closes odoo/odoo#99907

X-original-commit: b53c4a283d0e601636641b5753b6fc954dcb9f6a
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-09-09 17:29:52 +02:00
Géry Debongnie a42f554c23 [IMP] web: update owl from 2.0.0-beta-18 to 2.0.0-beta-19
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-19

Details:

- fix: events: correctly call handlers in iframes

closes odoo/odoo#99807

X-original-commit: 78f1dc7709a312f8e3c8ead36a69b4c41f5a0e07
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-09-09 11:12:32 +02:00
Géry Debongnie adc98beeb9 [IMP] web: update owl from 2.0.0-beta-16 to 2.0.0-beta-18
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-16
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-18

Details:

- imp: types: expose ComponentConstructor for typing purpose
- fix: compiler: fix falsy values for properties not keeping input empty
- fix: app: allow mounting owl apps in iframe
- fix: allow multiple occurrences of same slot in different locations

closes odoo/odoo#99554

X-original-commit: fb67514a52e10c53a09ab46c100873303f4ba1c8
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-09-05 20:13:14 +02:00
Dardenne Florent (dafl) 915b2c3d89 [IMP] web: daterange field: update daterangepicker library
The `daterangepicker` was in version 3.0.5, since then the library is
now in version 3.1.

This version introduce a new feature that allows to automatically
(depending on the space left) position the picker above or below
the HTML element it's attached.

This commit updates the library but also take advantage of this update:

Before when clicking on a daterange field, even if there was no space
 left below, the picker was still displayed below the field.
Now, the picker is displayed above the field if there is less space
 below the field

Part-of: odoo/odoo#99495
2022-09-05 18:35:16 +02:00
qsm-odoo 06e93c2489 [FIX] web: prevent wrong date format if picker used too soon on frontend
If datetimepickers were used too soon after page loading, they would use
the wrong format and UI options as the code in charge of initializing
those options was not fully lazy loaded yet.

With this patch, we prevent the tempusdominus lib to consider pickers
that are in a body that is marked by the lazyloader during the lazy
loading of JS files. We could potentially not add the lib attribute
(data-toggle="datetimepicker") on those elements and let the business
code initializing the pickers add it but that would not have been a
stable fix and it may be better this way as this works generically.

opw-2944720

closes odoo/odoo#98917

X-original-commit: 7e012340d3adcd64e829a5dca34173da24d649bc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-26 06:55:43 +02:00
Bruno Boi 400ffa0861 [IMP] web: update luxon from 2.4.0 to 3.0.1
See [upgrade guide](https://moment.github.io/luxon/#/upgrading?id=_2x-to-30)

Part-of: odoo/odoo#96946
2022-08-02 09:19:56 +02:00
Pierre Paridans a6857f276a [REM] web,debian: remove unused jQuery.touchSwipe lib
Since the revamp of the Kanban View in mobile and the migration of the
Settings view to the OWL views, the jQuery.touchSwipe library is not
used anymore.

closes odoo/odoo#96608

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-27 03:35:09 +02:00
Géry Debongnie b4063a1e73 [IMP] web: update owl from 2.0.0-beta-14 to 2.0.0-beta-16
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-15
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-16

Details:

- fix: lifecyle_hooks: correctly wrap errors in async code
- imp: use a custom error class for all errors thrown by owl
- fix: package.json: remove browser value
- ref: component_node: slightly simplify code
- fix: components: fix cause left unset when thrown object is not Error

Part-of: odoo/odoo#78221
2022-07-22 16:21:38 +02:00
Géry Debongnie 23caf8b96f [IMP] web: update owl from 2.0.0-beta-12 to 2.0.0-beta-14
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-14

Details:

- [FIX] compiler: better handle update of properties with same value

closes odoo/odoo#95804

Related: odoo/enterprise#29350
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-21 10:19:42 +02:00
abd-msyukyu-odoo 74753681ee [FIX] web: fix dragging a nest in article tree
When dragging an article with an open nest, the `jquery.mjs.nestedSortable`
library does not refresh the positions of the following articles. This forces
the user to drag the nest far below the target position to move the placeholder.

This commit is a small fix to the library, to refresh said positions before
checking for element intersection.

Task-2883290

closes odoo/odoo#95749

Related: odoo/enterprise#29315
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-14 16:42:01 +02:00
abd-msyukyu-odoo 4272e239de [FIX] web: prevent flickering when moving an article down
Prevent a flickering effect when dragging item down in a nested tree using the
`jquery.mjs.nestedSortable` library.

Situation:

1.) start dragging, moving down and slightly to the left

.dragged item
.nest0
  .nest00
    .nest000

2.) intersect nest0

.nest0:hover:.dragged item
  .nest00
    .nest000
.drop destination

3.1.LIBRARY) intersect nest00 first trigger

.nest0
  .nest00:hover:.dragged item
    .nest000
  .drop destination (frame 1)

3.2.LIBRARY) intersect nest00 second trigger (slightly below and to the left)

.nest0
  .nest00:hover:.dragged item
    .nest000
.drop destination (frame 2)

frame 1 and frame 2 are rendered almost simultaneously, and in a cycle (after
3.2. comes 3.1. again), resulting in a flickering effect.

3.1.FIXED) intersect nest00

.nest0
  .nest00:hover:.dragged item
    .nest000
.drop destination

drop destination is not allowed to go UP in the dom since the mouse is lower
than before. No flickering in this case.

To go up in the tree, the user can simply move the cursor to the right and/or
up.

The `jquery.mjs.nestedSortable` library will be rewritten internally in the
future to remove the jQuery dependency, but this fix allows a smooth utilisation
in the meantime.

Task-2883290

Part-of: odoo/odoo#95749
2022-07-14 16:42:01 +02:00
Adrien Dieudonne d5bf4ca473 [FIX] web, hw_drivers: bootstrap: removes js bundled Bootstrap file
Some modules used Bootstrap minified bundle but this was replaced
in [1] to avoid using of minified files.

We now want to have the same way to import bootstrap by using non-minified
individually compiled Bootstrap files (bootstrap/js/dist/).

Note that in 'hw_drivers', the js and css part was imported at the
same time but the javascript seems never used...

REF:
[1] https://github.com/odoo/odoo/pull/95450

Part-of: odoo/odoo#95628
2022-07-08 17:10:47 +02:00
Adrien Dieudonne 9d0bf51458 [IMP] web: bootstrap: remove source files
Sources files (boostrap/js/src/) are not used in Odoo.
We actually use:
- All at once compiled code (bootstrap/dist/)
  -> only for /hw_drivers (POS) and /web (database_manager)
- Individually compiled Bootstrap (bootstrap/js/dist/)

REF:
https://github.com/odoo/odoo/pull/95450
https://getbootstrap.com/docs/5.1/getting-started/contents/
https://getbootstrap.com/docs/5.1/getting-started/javascript/

Part-of: odoo/odoo#95628
2022-07-08 17:10:47 +02:00
Adrien Dieudonne 2bc60ad9bd [FIX] web: bootstrap: unwanted triggerTransitionEnd
There is a timeout that force the call to the transitionEnd
to prevent some issue [1]. '_cleanTipClass' callback was then
executed who call getTipElement.
It seems that the tip doesn't exists but the JS is still alive.
After that a crash occurs in [2]: _config is null.

Maybe jQuery was more permissive/defensive before BS5 and this error
was avoided.

So, we had this non-deterministic error:
> UncaughtTypeError: Cannot read properties of null (reading 'template')
Especially in 'test_17_website_edit_menus' with tooltip/popover.

Now we avoid the error in complete by checking if there is an element or
_config not null.

Ref:
[1] https://github.com/twbs/bootstrap/pull/33845/files
[2] https://github.com/twbs/bootstrap/blob/v5.1.3/js/dist/tooltip.js#L630
https://stackoverflow.com/questions/69766375/typeerror-cannot-read-properties-of-null-reading-template-on-bootstrap-tool
https://github.com/twbs/bootstrap/issues/25519

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli c48f57ea25 [IMP] web,*: upgrade to Bootstrap 5.1.3
* = base,http_routing,hw_drivers

- Update Bootstrap from 4.3.1 to 5.1.3

- Update PopperJS to version 2 for Bootstrap 5 (JS part)
  Some code was for PopperJS V1, but it's not compatible anymore.

- Remove some BS5 classes utilities backport

- Fix path for BS5

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:15 +02:00
Géry Debongnie 2fbb759124 [IMP] web: update owl from 2.0.0-beta-11 to 2.0.0-beta-12
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-12

Details

[FIX] compiler: properly handle t-set in t-if with no content

closes odoo/odoo#94868

X-original-commit: 942a7affd03e716d4b3271d2a3d62979ee90f625
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-06-29 17:11:36 +02:00
Géry Debongnie b36cf87878 [IMP] web: update owl from 2.0.0-beta-10 to 2.0.0-beta-11
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-11

Details:

[FIX] fix some issues with t-out with falsy values, and with default values
[REF] app: slightly simplify the create component path
[IMP] compiler: add support for binary operators
[IMP] add support for t-call-context directive
[FIX] properly get component reference instead of context
[FIX] blockdom: fix crash when class object key has leading spaces

closes odoo/odoo#94798

X-original-commit: 4dc5ff6569f658ccf525e9078b8a776ca5c0f159
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-06-28 20:42:25 +02:00
Géry Debongnie 2b2fe35ff3 [IMP] web: update owl from 2.0.0-beta-8 to 2.0.0-beta-10
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-9
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-10

Details:

closes odoo/odoo#94523

Fix: event: no crash when using t-on + modifier on slots/components
Fix: component: fix props comparison code
Fix: component: fix wrong behaviour when using t-on on t-component
Fix: component: props values are own property of props object
Fix: t-out: allow expressions evaluating as number
Fix: compiler: add support for #{...} in string interpolation
Fix: compiler: escape backticks in attributes
Fix: crash when dynamic class have leading space
Imp: slots: add support for t-props on slots props
Imp: tooling: add another d.ts file
Imp: app: small scale perf improvement
Imp: app: add fast path for when component has no prop
Imp: validation: add support for value types
Imp: add support for t-call-context
Ref: compiler: remove useless ; in compiled output
Ref: move some code around
X-original-commit: 3c7e2cb5a2224ff624e0899ca392be8b3828b43a
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-06-24 13:49:16 +02:00
Géry Debongnie 362f6b6d5b [IMP] web: update owl from 2.0.0-beta-7 to 2.0.0-beta-8
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-8

Fixes
-----

- portal: allow use of expression to describe portal target
- compiler: fix issue with identifiers with same name
- reactivity: fix memory leak
- app: validate props for root component in dev mode

Improvements
------------

- component: display nice error for wrong child component
- props_validation: have clearer error messages
- component: only useState on props that are already reactive
- compiler: add better support for "in" and "new" operators in templates
- misc: export the validate function
- app: add setting to warn if no static props object
- add static App.registerTemplate and update Portal to use it
- add basic infrastructure to buid owl-runtime without compiler

closes odoo/odoo#92599

X-original-commit: 7fc0cc7c3f1c770dd80e8c3f3316c249d0708fe4
Related: odoo/enterprise#27916
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-06-01 11:02:40 +02:00
Achraf (abz) daec4e6694 [IMP] web: Update Luxon to 2.4.0 version
closes odoo/odoo#92036

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-05-24 09:41:31 +02:00
Achraf (abz) eb9b28b2f8 [FIX] web: Allow user to display demo data in Vietnamese
Install the CRM app and the Vietnamese locale
Go to the CRM App > Reporting > Activities
Switch to Vietnamese (User icon > Preferences > Language)
The following error will appear :

```
UncaughtPromiseError > TypeError
Uncaught Promise > Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
    at parseDigits (http://localhost:8069/web/assets/debug/web.assets_backend.js:32038:31) (/web/static/lib/luxon/luxon.js:5117)
    at Object.deser (http://localhost:8069/web/assets/debug/web.assets_backend.js:32084:21) (/web/static/lib/luxon/luxon.js:5163)
    at match (http://localhost:8069/web/assets/debug/web.assets_backend.js:32423:37) (/web/static/lib/luxon/luxon.js:5502)
    at explainFromTokens (http://localhost:8069/web/assets/debug/web.assets_backend.js:32591:20) (/web/static/lib/luxon/luxon.js:5670)
    at parseFromTokens (http://localhost:8069/web/assets/debug/web.assets_backend.js:32614:30) (/web/static/lib/luxon/luxon.js:5693)
    at Function.fromFormat (http://localhost:8069/web/assets/debug/web.assets_backend.js:33592:30) (/web/static/lib/luxon/luxon.js:6671)
    at parseDateTime (http://localhost:8069/web/assets/debug/web.assets_backend.js:5814:32) (/web/static/src/core/l10n/dates.js:282)
    at parseDate (http://localhost:8069/web/assets/debug/web.assets_backend.js:5743:12) (/web/static/src/core/l10n/dates.js:211)
    at http://localhost:8069/web/assets/debug/web.assets_backend.js:20162:28 (/web/static/src/views/helpers/sample_server.js:460)
    at http://localhost:8069/web/assets/debug/web.assets_backend.js:10968:19 (/web/static/src/core/utils/arrays.js:96)
```

This is a issue with luxon
Issue: https://github.com/moment/luxon/issues/1169
Luxon update (2.4.0): https://github.com/moment/luxon/releases/tag/2.4.0
Fix: https://github.com/moment/luxon/pull/1194

PR to update luxon to 2.4.0 in master: https://github.com/odoo/odoo/pull/92036

closes odoo/odoo#92109

X-original-commit: 354433e7ba5b5f81f83368e497a8bed5059c91d5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-05-23 22:25:53 +02:00
Nicolas Bayet 3c14a3810e [FIX] mass_mailing: traceback when discarding while a popover is open
task-2810559

closes odoo/odoo#90697

X-original-commit: dc30885de4717bc1ead0251a65d7b07fef138c84
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-06 12:27:49 +02:00
Hubert Van de Walle (huvw) 34fa3126bd [FIX] web: Add Mongolian moment locale
Steps to follow:

  - Switch the current lang to mongolian
  - Go to a list view
  - Add a custom filter on a date type field
  -> locale() locale mn-MN is not loaded from moment locales!

Cause of the issue

  - moment.js tries to use the mongalian locale but it is not present

Solution

  Add the mongolian locale (from moment 2.29.2)

opw-2829233

closes odoo/odoo#90704

X-original-commit: 179a4b2f31d8e2e0e2be308917725a05c5b78058
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-05-06 09:38:11 +02:00
Xavier Morel f0fe59dcf7 [FIX] web/lib: backport jquery bugfixes
opw-2793379

closes odoo/odoo#90463

X-original-commit: 684e3fc983e91168dfaef8536fcd1f71ce7f7fdc
2022-05-04 00:05:02 +02:00
Xavier Morel 9ac8050de8 [REV] web/lib: Revert: backport jquery bugfixes
This reverts commit 0dd7c78b06726543825008a48d3dc004d2af4557.

X-original-commit: b50cd480d3f40ab084689587e6cbed311c09fb2f
Part-of: odoo/odoo#90463
2022-05-04 00:05:01 +02:00
Samuel Degueldre 03763da5bf [IMP] web: update owl to version 2.0.0-beta-7
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.0-beta-7

closes odoo/odoo#89937

X-original-commit: b0a807ff5ea36b08ec027ac19ac6d0b9ee360ab8
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-04-28 08:02:05 +02:00
Géry Debongnie 0111b77aac [FIX] web: update owl to last version
This commit includes a fix in the way Owl schedule renderings:
https://github.com/odoo/owl/pull/1176/commits

closes odoo/odoo#89034

X-original-commit: 497c754bab4629deb517b7b7995b06d55e41ab2f
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-04-19 16:40:10 +02:00
Géry Debongnie d82003382f [IMP] web: update owl to last version
This owl update is significant: it introduces a change in the way
components are rendered: now, child components check if there is a
current rendering somewhere in their ancestors. If this is the case, the
rendering will be delayed.  This prevents lots of issues where a
child components may be in some kind of corrupted state after some state
changes.

closes odoo/odoo#88572

X-original-commit: 93710d082bf860d0ea576fe99db9506af9bb42b0
Related: odoo/enterprise#26135
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-04-12 17:42:08 +02:00