Commit Graph
652 Commits
Author SHA1 Message Date
Samuel Degueldre 627259e0da [IMP] web: update owl from 2.2.4 to 2.2.5
Release notes:
https://github.com/odoo/owl/releases

Commits:
[FIX] compiler: fix xmlns attribute not being set correctly in firefox
[FIX] compiler: fix t-call at root of template causing crashes
[REF] compiler: minor cleanup
[FIX] devtools: fix inspected path

closes odoo/odoo#131082

X-original-commit: ad9db912c45ebd49d9df87fbaee1f8b49421b081
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-07 20:59:06 +02:00
Pierre Paridans 3fd016a443 [IMP] web,survey,website_slides: remove unused jQuery Form plugin
None of the main methods provided by this plugin were stil used; only
the internal method `enable()`.

This commit replaces these calls by toggling the `disabled` HTML
attribute.

closes odoo/odoo#130817

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-04 15:02:27 +02:00
Pierre Paridans d6edddb216 [IMP] web,point_of_sale,website_slides: remove legacy daterangepicker
Note: the "event_tour" stil has step targetting the .daterangepicker
selector... but as this tour is broken since (at least) 14.0, its fix
will be tackled in another PR.

closes odoo/odoo#129993

Related: odoo/enterprise#44742
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-04 13:42:00 +02:00
Pierre Paridans 690e184dd2 [IMP] web,website_slides: removes placeholder attribute polyfill
Mainly used for Internet Explorer support (cf. placeholder attribute is
supported since IE 10).

We are in 2023...

closes odoo/odoo#130692

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-04 10:59:16 +02:00
Aaron Bohy 3fac03b7f4 [REF] web,*: remove legacy Domain, Context and pyjs
This commit removes the legacy implementations of Domain, Context
and the pyjs library. All of them exist in the new codebase, and
the few pieces of code that were still using the legacy ones have
been adapted.

Part of task~3439226

closes odoo/odoo#130647

Related: odoo/enterprise#45129
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-03 18:02:55 +02:00
Géry Debongnie 7c748bbcbe [IMP] web: update owl from 2.2.3 to 2.2.4
Release notes:
https://github.com/odoo/owl/releases

Commits:
[FIX] compiler: fix swapped key/value using t-foreach on Map
[FIX] devtools: fix crash while highlighting env
[FIX] *: move OwlError to common
[FIX] playground: todo app clear complete tasks
[IMP] compiler: improve error message when failing to compile template

closes odoo/odoo#130547

X-original-commit: b8346973103b6d927c98c97179878769c0784ce8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-02 17:29:42 +02:00
Maximilien (malb) e3f4651c52 [FIX] * : Display improvement
This PR will introduce multiple display improvements. Here is the list:

- In the accounting settings, the fiscal localization section has a button that
was oddly placed. This PR solves that issue.

- On the dashboard, when clicking the three dots on a card, the options "remove
from favorites" and "configuration" were not aligned.

- In ir_attachment, the label and field of "datas" will be aligned, and a gap
will be added between the icons.

- In the settings, the button links were inconsistent in terms of padding. This
PR resolves that.

- In the payment providers, two button links had text wrapping issues. By adding
 Bootstrap classes, this has been resolved.

closes odoo/odoo#130522

Task-id: 3342969
X-original-commit: d4ba0c1f69212bfb0030036951c2888e935bbdf0
Related: odoo/enterprise#45060
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-08-02 17:29:27 +02:00
Géry Debongnie db5b2ade8d [IMP] web: update owl from 2.1.4 to 2.2.3
Release notes:
https://github.com/odoo/owl/releases

Commits:
[FIX] app: sync destroy everythig when app is destroyed
[FIX] tools: include proper version number in released build
[IMP] runtime: add support for Map and other iterables in t-foreach
[IMP] runtime: only destroy component in raf callback
[REF] runtime: simplify implementation of batched
[FIX] compiler: allow t-model.number to work with select
[FIX] devtools: Fix crash when no root node
[FIX] devtools: fix/imp env display
[FIX] devtools: fix symbols handling and display

closes odoo/odoo#129438

X-original-commit: b1a13ad11f7f59632dbfb7de6dae0e57b7d44b02
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-07-26 12:00:25 +02:00
Julien Mougenot a540f0f53c [FIX] web: Allow TempusDominus to parse its own values
Before this commit, in other numbering systems than "latn", the time
pickers did not allow to select hours/minutes/seconds. This was because
the lib (TempusDominus) would use `parseInt` internally to retrieve the
selected value, which was not a latin number in other numbering systems.

This commit changes 2 things directly in the lib file:

- allow the internal `getMoment` function to accept a second 'format'
parameter;

- use that same `getMoment` function to parse the text of the selected
value, effectively using moment to both parse and format the values
displayed in the picker and ensuring consistency.

OPW-3258034

closes odoo/odoo#126711

X-original-commit: de6bc96afdc61b57493bcbde0b8f3479cc6ebd71
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-30 13:08:23 +02:00
Géry Debongnie 3bf76fcb9e [IMP] web: update owl to 2.1.4
Release notes:
https://github.com/odoo/owl/releases/tag/v2.1.4

This release contains mostly devtools improvements, but there are three
small bug fixes as well:

[FIX] blockdom: properly merge dynamic class values
[FIX] parser: make t-on stricter
[FIX] compiler: apply translations to t-set text body

closes odoo/odoo#126755

X-original-commit: b26a66d928aad283c7ec17d767c6bc1e42e24206
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-29 00:18:47 +02:00
Pierre Pulinckx (pipu) 28e1e61e5c [REF] web, pos, website_slides: Remove totally underscoreJS
After this commit, underscore library is totally removed.
Library calls has been removed from manifests.
Library files has been deleted.
This commit closed the task below.

task-3246238

closes odoo/odoo#125889

Related: odoo/design-themes#662
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-26 15:11:55 +02:00
Hubert Van de Walle (huvw) 426d95eecd [FIX] web: remove duplicate month in arabic
Steps to reproduce
==================

- Switch to arabic
- Open a datepicker
- Select the month

The month are displayed twice in two different arabic namings.

Cause of the issue
==================

There is an issue in the moment locale files since [0]. It has been made
apparent since [1].

Solution
========

Cherry pick a fix from the moment repo [2].

Revert the ar.js locale from before [0]

[0]: 11f3e7351a899848ec4df0107c3f6e2a627807ba
[1]: 6a1183f4c93ad068524a3242cd7b4e37f68fbf95
[2]: https://github.com/moment/moment/commit/251fba65cca5d5b2cf79f1f51a9d413c5e0cb161

opw-3349560

closes odoo/odoo#125381

X-original-commit: bfdf5baf4017058d7aff7c93fd504e684ed6783a
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-16 13:41:17 +02:00
Brieuc-brd 42f28ec012 [IMP] web: oi_icons, add "view", "archive" and "unarchive" icons.
task-3337951

X-original-commit: f1484bd88c2f22798fd5e692d99e84c88f63ae12
Part-of: odoo/odoo#124413
2023-06-09 17:01:05 +02:00
Pulinckx Pierre (PIPU) f2a8e6bd51 [REF] web: Remove underscore.js
Underscore.js has been removed from legacy qweb engine
and from web manifest.py
range and uniqueId functions has been added to qweb
engine to replace usages of them in xml templates.
Underscore usages has been remove from xml templates.
taskId : 3246238

closes odoo/odoo#123018

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-05 13:31:35 +02:00
Pulinckx Pierre (PIPU) f4f0f78318 [REF] *: Replace underscore.js function by native JS
Before this commit : The library underscore.js and
underscore.string.js were used in the ODOO solution.
After this commit : Every usages of a function from
underscore.js lib has been replaced with native javascript.
The goal is to remove all usages of underscore.js and to
not use anymore this library in ODOO.
---
TaskId : 3246238

closes odoo/odoo#120437

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-15 09:37:48 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
stefanorigano (SRI) 2b32d1431a [IMP] web: increase base font-size to 14px
task-2818586
task-3280695

Part-of: odoo/odoo#116641
2023-05-12 22:59:11 +02:00
Michael (mcm) 517d3258f2 [REF] web,*: add dependencies param to odoo.define
This commit makes the `dependencies` param of
`odoo.define` mandatory. It was optional and when
omitted, a regexp read the function to find the
dependencies. We can simplify it now almost all js
modules have been converted to esm.
The transpiler already adds the param for the es
modules except if the module has an alias.

task id: 3271352

closes odoo/odoo#119145

Related: odoo/enterprise#40040
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-05-03 12:39:30 +02:00
Géry Debongnie 425f0fc115 [IMP] web: update owl from 2.1.2 to 2.1.3
Commits:

[FIX] components: properly differentiate t-call subcomponents
[REF] devtools: Better messages forwarding
[FIX] devtools: Fix app methods patching
[DOC] Fix a code bug in the example of slots

See https://github.com/odoo/owl/releases/tag/v2.1.3

closes odoo/odoo#120196

X-original-commit: c44d944192fb583aa3fdfa43a5b175c90907525d
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-29 14:10:08 +02:00
Géry Debongnie 41ae9fe011 [IMP] web: update owl from 2.1.1 to 2.1.2
This release only contains a bug fix:

[FIX] t-out: does not crash when outputting null

See https://github.com/odoo/owl/releases/tag/v2.1.2 for more details.

closes odoo/odoo#119582

X-original-commit: 363f946b13c268a280a03b57ad9ba94f60feaaa5
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 08:35:47 +02:00
Géry Debongnie 9a1dd53f89 [IMP] web: update owl from 2.0.9 to 2.1.1
This update contains the following commits:

[FIX] components: solve missing update (concurrency issue)
[DOC] remove old references to comp for useRef hook
[FIX] devtools: Fix build commands for windows users
[FIX] devtools: Fix devtools in detached window
[IMP] devtools: Add a button to navigate to the doc
[IMP] devtools: Add devtools documentation
[IMP] Allow app to be mounted in shadow DOM
[IMP] playground: allow sharing playground links
[IMP] runtime: allow validating object values using a type description
[FIX] devtools: Increase vertical padding of the search bar
[FIX] devtools: Hide the collapse all button
[FIX] devtools: Fix bad computation of highlight boxes on the page
[FIX] package: Auto-update package-lock.json

closes odoo/odoo#118798

Notes: https://github.com/odoo/owl/releases/tag/v2.1.1
X-original-commit: a57cd7b2f84a4ebc06f93cabb903d1ff6f23e23c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-17 16:35:09 +02:00
Géry Debongnie 70a412f325 [IMP] web: update owl from v2.0.7 to v2.0.9
This update contains the following commits:

[IMP] implement .alike suffix on props
[IMP] release: add version number on App
[IMP] app: add name as a config option
[FIX] runtime, compiler: fix refs getting set or unset incorrectly
[FIX] compiler: call translate function with correct string
[FIX] compiler: properly handle readonly attribute/readOnly property
[REF] blockdom,compiler: implement properties
[REF] tests: move properties tests in own file
[FIX] compiler: dynamic value on inputs doesn't turn 0 into empty string
[FIX] components: do not crash when binding anonymous function

More details at: https://github.com/odoo/owl/releases/tag/v2.0.9

Note that this owl update required a few adaptations in Odoo code. The
main problem was that some code would access references after the
component was unmounted. However, Owl is now stricter and properly
remove the reference.

closes odoo/odoo#115991

X-original-commit: a2952026f23858a8d34dcdab4ec8b467f7fc9bcf
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-22 11:06:46 +01:00
fdardenne 6d3bfbe47c [FIX] web: daterangepicker: fix the end date when keyup
This commit deactivates the daterangepicker from reacting to the
`input` keyup events.

The handler for input keyup must only be the parent because
daterangepicker does not have access to both the start and end date
inputs.
As a consequence of not having access to both inputs, the
daterangepicker always sets the end date to the start date when a date
input is modified.

**Steps to reproduce:**

- Go to the event app and open a record
- Click on an input of the date range picker, and the picker opens
- Move the cursor in the input with the keyboard (right or left arrow)
- The picker loses the range

**Current behavior:**
The picker sets the end date to the start date whenever there is an
onKeyup event on the input.

**Expected behavior:**
The picker should not reset the end date when there is an onKeyup
event on the input.

closes odoo/odoo#115834

Ticket-id: 3198864
X-original-commit: 2a1857db4bee43ff266b4be279791c9b5c957085
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 16:51:23 +01:00
Xavier Morel b799ef34ae [FIX] web: disable scripting & autoprint in PDF viewer
Support is limited and more of a hindrance than a help, as some
clients' suppliers create PDFs with broken scripting which trigger the
autoprinting any time they're loaded and can have other odd
misbehaviors, which is a hassle.

OPW-3208409
OPW-3222228

closes odoo/odoo#115659

X-original-commit: a7331d9709c8e097356f89bf144986f441c8f2cc
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-03-17 20:21:09 +01:00
Elisabeth Dickinson 98f5503e95 [IMP] web: add icons to odoo_ui_icons font for text-wrapping styles
Add new icons allowing editor to choose how text should wrap around the
image when adding a picture inside a paragraph.

task-3235798

closes odoo/odoo#115629

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-03-17 20:21:07 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Géry Debongnie abaf9d0e70 [IMP] web: update owl from v2.0.6 to v2.0.7
This update contains the following commit:

- [FIX] compiler: t-key and t-ref together

More details at: https://github.com/odoo/owl/releases/tag/v2.0.7

closes odoo/odoo#113385

X-original-commit: 1624282af36cd4b8ce228a3c47ed1de92cefa9c5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-02 19:25:16 +01:00
MerlinGuillaume d1d3992dc0 [FIX] web: add Mongolian moment locale
An error is raised when trying to render date picker with the Mongolian
locale

Steps to reproduce:
1. Install Sales
2. Install and switch to Mongolian language
3. Open Sales and create a new quotation
4. An error is raised: `locale() locale mn-MN is not loaded from moment
   locales!`

Solution:
Add the Mongolian locale. It is not present in the version of Moment.js
we use (2.19.3) so we get it from a newer version (2.29.2)

Problem:
The Mongolian locale was unintentionally removed in this PR
https://github.com/odoo/odoo/pull/111986 so we add it back

opw-3188184

closes odoo/odoo#113983

X-original-commit: 055c13af01c445c5e105d63ea3cd98e3ad2915a8
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-03-01 23:28:13 +01:00
Géry Debongnie 785e4fa812 [IMP] web: update owl from v2.0.5 to v2.0.6
This update conatins the following commit:

 - [IMP] devtools: provide access to Fiber and RootFiber
 - [FIX] props validation: do not subscribe to props keys
 - [FIX] reactivity: only show key in subscription if observed by callback
 - [FIX] components: stop rendering stale t-component when delayed

More details at: https://github.com/odoo/owl/releases/tag/v2.0.6

closes odoo/odoo#113041

X-original-commit: fd67ca5d2aaa9683ac1e4667e76fc4230d5d62c6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-18 02:49:53 +01:00
Romeo Fragomeli 79a87e854c [IMP] web: upgrade ZXing.js to version v0.19.2
Part-of: odoo/odoo#112855
2023-02-17 12:07:19 +01:00
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