Commit Graph
675 Commits
Author SHA1 Message Date
Romain Estievenart bd8565be2b [REF] web,*: remove jQueryUI
*: mrp_subcontracting, project, test_website, web, web_editor,
   website_slides

This commit removes jQueryUI autocomplete that was the last usage of
jQueryUI.

No longer usage of these features inside the codebase

task-3439226

Part-of: odoo/odoo#139209
2023-11-02 21:02:44 +00:00
Pierre Paridans 963842381e [IMP] web,*: replace ClipboardJS with Web API and homebrew polyfill
*: auth_totp_portal, mrp_subcontracting, project, survey, web_editor,
   website, website_links, website_sale_loyalty, website_slides, test_lint,
   spreadsheet

Implements missing `clipboard.write()` and `ClipboardItem` ; targets
only Firefox (which partially implements Clipboard API, features hidden
behind a preference flag).

Supported browsers: Chromium 76+, Safari 13.1+, Firefox 63+, Safari iOS
13.4+.

This allows to replace ClipboardJS by the native Clipboard Web API.

Reference:
https://caniuse.com/?search=clipboard
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
https://w3c.github.io/clipboard-apis/

task-3439226

closes odoo/odoo#134881

Related: odoo/enterprise#47154
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-26 07:22:54 +00:00
xO-TxandChrysanthe f64c9f27f1 [IMP] web, web_editor, website: add text highlight effects
The goal of this commit is to replace the "Toggle underline" option
from the website's text editor by a new "Highlight effects" option which
should allow applying some highlights on the selected text and setting
their color & thickness. Also, the text editor "Toggle strikethrough"
option will be moved to the list of highlight effects in the new option.

For this purpose, the JS code used for text animations will be updated
to be more generic and handle text highlights too. Moreover, The "Text
Highlight" options will be applied by adding a SVG to the targeted text
element (allowing to adjust their `stroke` and `stroke-width`).

To simplify adapting highlights when the text content is updated,
we follow this generic structure:
```
<span class="o_text_highlight">
    <span class="o_text_highlight_item">
        line1-textNode1 [line1-textNode2,...]
        <svg.../>
    </span>
    [<br/>]
    <span class="o_text_highlight_item">
        line2-textNode1 [line2-textNode2,...]
        <svg.../>
    </span>
    ...
</span>
```

Rendered line breaks in text nodes are detected using range client
rectangles (see: `text_processing.js` > `splitNodeLines()`), and the
highlights are updated on window resize...

We also need to adjust highlight SVGs to fit an updated text in "edit
mode" (mainly using editor's commands), a `MutationObserver` is used
for this purpose (we only redraw the SVG for each text unit).

A simple SVG path generator was implemented in this commit (see:
`text_processing.js` > `drawPath()`) to build highlights. It applies a
list of SVG path commands according to text dimensions in a specific
mode (E.g. on "pattern" mode, we repeat the same elementary path to fit
targeted text node...).

Remarks:

- The `--text-highlight-width` and `--text-highlight-color` properties
are used to control the highlight effect's thickness and color.

- We build the highlight option preview in the same way as text content.
To achieve this, a hack was used (we open the `<we-select/>` first since
we need the right `getBoundingClientRect()` dimensions to correctly draw
highlight SVGs).

task-3285817 (rd-website)
task-3269759 (rd-design)

closes odoo/odoo#122751

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Chrysanthe (chgo) <chgo@odoo.com>
2023-10-25 11:37:14 +00:00
Arthur Detroux (ard) 7594d71ca8 [IMP] *: remove jQueryUI draggable and droppable
*: mass_mailing, test_website, web, web_editor, website, website_event,
   website_sale

This commit removes jQueryUI draggable and droppable component to
instead use our own implementation of the feature. This replaces the
last use of the lib: the web_editor drag and drop. This takes advantage
of the code that was already written for other features of the backend.

task-3079246

closes odoo/odoo#136793

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-19 22:01:48 +00:00
Romeo Fragomeli 5f454f0ccb [IMP] web,web_editor,website_slide: sortable service for frontend usage
This commit removes the module sortable from jQueryUI and adds instead a
sortable service to use the sortable code already used by the backend.

The service can be called using `this.call("sortable", ...)` and the
sortable listeners are added when the `enable` function is called.
This function (`enable()`) returns an object that contains the `cleanup`
function (`cleanup()`).

```javascript
// start / setup
const sortable = this.call(
    "sortable",
    "create",
    {
        ref: { el: document.querySelector(".list") },
        elements: ".items",
        handle: ".drag-icon",
    },
);

// on attach callback / on mounted
const sortableInstance = sortable.enable();

// on destroy / on willUnmount
sortableInstance.cleanup();
```

Also, it adds some new property to the useSortable:
* clone: the placeholder is a clone of the drag element
* placeholderClasses: classes added to the placeholder element
* applyChangeOnDrop: on drop the change is applied to the DOM
* followingElementClasses: classes added to the element following mouse

task-3439226

closes odoo/odoo#137527

Related: odoo/enterprise#48371
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-10 01:59:35 +00:00
Romain Estievenart adba68440b [IMP] *: remove jQuery.nested_sortable
task-3439226

closes odoo/odoo#136375

Related: odoo/enterprise#47807
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-03 19:20:06 +00:00
Aaron Bohy 2f9c4979fa [IMP] web,survey: better error management in tests
The initial motivation of this commit was to ensure that the qunit
test suite doesn't stop when an error is thrown in a test, which
could happen if the error was thrown "sufficiently close to the
end of the test". Indeed, the "unhandledrejection" event being
async, it was sometimes triggered after the end of the test, when
the service registry was already reset, and the check of the
presence of the error service was wrong, so the error event wasn't
default prevented (e.g. await makeView(...) and the view crashes
at render time).

This led us to rework in more depth the way we deal with errors in
tests. Here are a few behaviors we want (probably not exhaustive):
 - an error in a test must never end the suite (executed in py)
 - an error in a test must always make the test fail, except if the
   error is expected in the scenario, which one must be able to
   state
 - a test must always wait for potential unhandledrejection events
   to be triggered before ending.
 - ideally, we don't want to have to deal with unhandledrejection
   in each test throwing an error (in order to prevent the suite to
   stop)

To achieve this, we come with the following solution. We introduce
a new assertion method, "expectToThrow" which allows to state that
during the test, we expect errors to be thrown. It takes a list of
error messages that will be compared at the end of the test with
the errors that have been thrown during the test. If they differ,
a qunit failure is pushed and the test fails. If an error occurs
in a test and "expectToThrow" hasn't been called, qunit is directly
informed of the error and a failing assertion is done, make the
test fail as well.

If the error service isn't available in the test environment, we
apply the logic above when an "error" or and "unhandledrejection"
event is thrown. If the error service is available, we wrap the
default handler (typically the one that handles everything that
hasn't been handled by specific handlers, like tracebacks) and if
we get to it, we apply the logic above. This means that one must
call "expectToThrow" if
 - the error service isn't deployed, or
 - the thrown error is handled by the default handler, because
   it is something like a traceback (errors like UserError,
   ValidationError are graciously handled by the RPCErrorHandler)
   and thus never reach the default handler.

In all cases, we prevent default the event such that the error
doesn't make the python test end.

Finally, to ensure that "undhandledrejection" events are handled
before the test ends, we wait, in the qunit lib, for a setTimeout
before ending the test, which ensures that all such events have
been dispatched.

closes odoo/odoo#137120

Related: odoo/enterprise#48211
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-03 06:16:46 +00:00
Géry Debongnie a54865632c [IMP] web: update owl from 2.2.5 to 2.2.6
Commits:
[IMP] devtools: add svg elements detection
[FIX] reactivity: do not notify for NOOPs on collections
[IMP] app: export apps set as static property
[IMP] runtime: do not check template equality outside dev mode
[FIX] runtime: properly support t-foreach on strings

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

closes odoo/odoo#136591

X-original-commit: c92f9f8a7de6e10354ec0feea64bfc045a0edafb
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-09-27 18:56:17 +00:00
Géry Debongnie 08dec02ea0 [IMP] web: prevent jquery from throwing error at start
To test which browser is currently running, jquery performs some checks
when it starts, by doing invalid queryselectors. Depending on which
selectors crashes, it can determinate if it is running in an old browser
and need to activate some part of the code to support them.

This would not be a big deal, except that it makes the life of some
developers much more difficult: we can no longer easily reload a page
with a "Pause on exception" setting to debug odoo. Doing so works, but
the workflow is polluted by 3 errors initially.

It is so common that I propose to simply remove the checks. This should
be acceptable, since Odoo does not work on old browser versions anyway

We are talking about firefox 5, opera 11 or "Gecko", for a commit that
is at least 11 years old

closes odoo/odoo#136013

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-20 13:03:14 +00:00
Pierre Paridans 25d0783b59 [IMP] web: reduce jquery-ui lib (remove useless modules)
Includes: widget.js, position.js, data.js, keycode.js, scroll-parent.js,
unique-id.js, widgets/draggable.js, widgets/droppable.js,
widgets/sortable.js, widgets/autocomplete.js, widgets/menu.js,
widgets/mouse.js

task-3439226

closes odoo/odoo#135491

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-15 10:48:28 +00:00
Samuel Degueldre 4327c062d8 [REF] web, *: remove moment.js library
The moment.js library is officially done and no longer recommends its
use for new projects. As such, we have been progressively moving to
luxon instead. Until recently, we still had some libraries that depended
on it, and some leftover calls to it. This is no longer the case, and as
such, the library can be removed completely.

closes odoo/odoo#135182

Related: odoo/enterprise#47304
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 08:20:37 +00:00
Pierre Paridans bb18aace54 [IMP] web,*: removes jQuery.browser
This commit removes the $.browser as not used anymore and already
removed in jQuery itself in v1.9, and reintroduced in our codebase to
support jquery.ba-bbq (in odoo/odoo@4d07900cf7)
which was also removed.

Reference:
https://api.jquery.com/jquery.browser/

task-3439226

closes odoo/odoo#133916

Related: odoo/enterprise#46736
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-05 19:58:08 +00:00
Bruno Boi fde29ed157 [IMP] web: bump luxon lib from 3.0.1 to 3.4.2
**Changelog**

**3.4.2 (2023-08-26)**

- Fixes regression from 3.4.1 (moment/luxon#1493)

**3.4.1 (2023-08-23)**

- Fixes for regressions from 3.4.0
  (moment/luxon#1482 and moment/luxon#1488)

**3.4.0 (2023-08-08)**

- Fix type checking on input zones
- Fix Islamic months listing
- Fix normalize() for negative inputs

**3.3.0 (2023-03-03)**

- Fix off-by-one in Interval#count (moment/luxon#1308)
- Support formatting for custom zones (moment/luxon#1377)
- Fix parsing for narrow spaces (moment/luxon#1369)
- Handle leap year issue with AD 100 (moment/luxon#1390)
- Allow parsing of just an offset

**3.2.1 (2023-01-04)**

- Fix for RFC-2822 regex vulnerability
- Better handling of BCP tags with -x- extensions

**3.2.0 (2022-12-29)**

- Allow timeZone to be specified as an intl option
- Fix for diff's handling of end-of-month when crossing leap years
  (moment/luxon#1340)
- Add Interval.toLocaleString() (moment/luxon#1320)

**3.1.1 (2022-11-28)**

- Add Settings.twoDigitCutoffYear

**3.1.0 (2022-10-31)**

- Add Duration.rescale

**3.0.4 (2022-09-24)**

- Fix quarters in diffs (moment/luxon#1279)
- Export package.json in package (moment/luxon#1239)

**3.0.2 (2022-08-28)**

- Lots of doc changes
- Added DateTime.expandFormat
- Added support for custom conversion matrices in Durations

closes odoo/odoo#133599

Related: odoo/enterprise#46556
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-09-04 09:19:11 +00:00
Samuel Degueldre 910897fc97 [REF] web, *: remove tempusdominus date(time) picker lib
As tempusdominus relies on jQuery, we have written our own date(time)
picker in owl. This commit converts the remaining uses of the
tempusdominus date(time) picker and replaces them by our own.

closes odoo/odoo#133349

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-09-04 09:19:08 +00:00
Romain Estievenart 507c368836 [IMP] *: remove jquery.ba-bbq 🍖
Task Id: 3439226

closes odoo/odoo#133763

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-01 15:09:51 +00:00
Pierre Paridans ead4f57b3b [IMP] web,*: remove jQuery.hotkeys
Apparently unused library introduced in 022bff6.

task-3439226

closes odoo/odoo#133725

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-31 12:26:47 +00:00
Adrien Dieudonne 3d56c3db42 [REF] web, *: Replace jQuery BlockUI by uiService
Task ID: 45869

closes odoo/odoo#132295

Related: odoo/enterprise#46166
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-08-24 21:59:43 +02:00
Brieuc-brd 003678d1dd [FIX] web: adapt directional icons for rtl
Prior to this commits, new directional icons [1] from the ui icons
library were not adapted for RTL language.

This commit fixes this issue.

[1] 418413e499

task-3414560
Part of task-3326263

closes odoo/odoo#132946

X-original-commit: 8f3ea530a52e3c51f4f46f95119e093a37266e6c
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-08-24 20:03:33 +02:00
Pierre Paridans 8164f107be [IMP] web,web_editor,point_of_sale: remove jquery.nearest library
This library provided the `nearest()` and `touching()` methods.

This commit replaces them by our own utility methods from
`@web/core/utils/ui`: `closest()` and `touching()`.

closes odoo/odoo#130818

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-21 12:38:57 +02:00
Chrysanthe (chgo) 8120fca14f [FIX] account, kanban_dashboard: fix favorite alignment
Commit[1] introduced some changes in order to fix a layout issue in the
accounting dashboard but these changes were applied in a way that affects
a lot of modules and files that should not be modified.

In fact, by removing the padding inside the `kanban_dashboard.scss`
commit[1] is actually removing the padding in every place where
the boolean_favorite widget is used.

There is also a change applied in the Bootstrap library files, which
should remain untouched.

=== AFTER ===

We revert the changes applied by commit[1] and also fix the layout issue
in the accounting dashboard that it aimed to fix.

commit[1]: d4ba0c1

task-3453799
part of task-3326263

closes odoo/odoo#132134

X-original-commit: f78571cec0a5debf78c5dd1859c78b13d33df1ab
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-17 01:04:34 +02:00
Romain Estievenart 4ae61cee22 [IMP] web *: remove unused jquery.scrollTo library
*: project, mrp_subcontracting

This commit is a code cleanup, we remove an unused lib from the codebase

The last usage of jquery.scrollTo was dropped in saas-16.4 after the
refactoring of livechat, see here [1].

Note that we have our own ´scrollTo´ utility.

References :
https://github.com/flesler/jquery.scrollTo

[1] https://github.com/odoo/odoo/commit/20c1772d351e14e5233a636313dc79c2fe5b9115#diff-8925fb7187d27cf7abc3fbb149a22cdcfa83eaa435a667b5beb042c4fd0fe3fdL220

closes odoo/odoo#132035

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-16 17:47:56 +02:00
Pierre Pulinckx (pipu) 7e3c1ecdb8 [REF] *: Update Chart.js to V4.3
Change version of Chart.js from V2.9.3 to V4.3.0
You can find changelog on
https://www.chartjs.org/docs/latest/migration/v4-migration.html

Version 4.3.0 of chart.js no longer uses moment.js. This task is a
prerequisite to completely remove the use of moment.js (task 3391739)

Why add aspectRatio : 2 ? => Canvas aspect ratio (i.e. width / height,
a value of 1 representing a square canvas). Note that this option
is ignored if the height is explicitly defined either as attribute
or via the style. The default value varies by chart type; Radial charts
(doughnut, pie, polarArea, radar) default to 1 and others default to 2.

Why no more Chart.animationService.advance(); ?
There is no longer an equivalent in this version.
However, we have verified that the problem is no longer present in this
version.

Why use now getElementsAtEventForMode ?
It's clearly noted in the changelog. follow the link above.

task-3392075

Part-of: odoo/odoo#127259
2023-08-16 12:47:34 +02:00
Jorge Pinna Puissant 4b0a951af6 [REM] remove qweb library
Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
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