Commit Graph
17702 Commits
Author SHA1 Message Date
Leonardo Pavan Rocha 064213901b [IMP] calendar: rework recurrence in UI
This commit changes the way we define recurrences from the UI so it's simpler.
Instead of showing the user many options for recurrence like we currently do,
we add a selection field for each rrule (daily, weekly, monthly and yearly)
that sets some default values for the recurrence without the user having to
define each field manually. This change makes the definition of recurrence from
the UI closer to what is done in google calendar. In order to allow users to
define more advanced types of recurrence, we also add a custom option in the
new selection field that will show the old recurrence options to the user.

Additionally, the week days widget defined in web takes too much space, so it
was decided to create an overwrite of this widget for calendar only that looks
cleaner and takes less space. This commit introduces this new widget and
applies it to the calendar event form view.

task-3234677

closes odoo/odoo#116649

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-09-04 15:02:46 +00:00
Adrien Schoffeniels 484570e65b [IMP] web: add tests for useNestedSortable hook
Purpose:
--------
This commit adds QUnit tests for the `useNestedSortable` hook.

This commit also fixes a few issues in the hook that were pointed out by
adding these tests, notably:
- the moves are now triggered based on the position of the top of the
dragged element instead of the position of the cursor (behavior was
unclear when moving long elements)
- when nesting is allowed, moving an element under another one that does
not have nested elements now inserts the placeholder after the element
instead of nesting it inside of it.

It also renames the `listType` parameter to `listTagName` to make its
purpose clearer, and moves the placeholder styling to a custom class so
that it can be customized more easily.

Task-3422012

Part-of: odoo/odoo#131769
2023-09-04 10:56:05 +00:00
Adrien Schoffeniels 20cd86d464 [IMP] web: rename useSortableList hook to useNestedSortable
Purpose:
--------
Rename the hook to better reflect its main behavior.

Task-3422012

Part-of: odoo/odoo#131769
2023-09-04 10:56:05 +00:00
Adrien Schoffeniels 4db24cbedd [MOV] web: move useSortableList hook to web utils
Purpose:
--------
The `useSortableList` hook introduced to replace the usage of the jquery
library nestedSortable in knowledge sidebar is suitable for the sidebar
in documents, which currently does not allow to move a folder between
other folders.

The hook is moved to web so that it can be used in both modules

Task-3422012

Part-of: odoo/odoo#131769
2023-09-04 10:56:05 +00:00
Mahdi Cheikh Rouhou (macr) b580444adc [FIX] web : save chatbot lines without error
Iusse:
======
When you update a chatbot a line and then save the chatbot form it will
throw an error.

Steps to reproduce the error:
=============================
1-Go to Live Chat/configuration/Chatbots and select one
2-update one line in the script (add some letters in one name)
3-save the chatbot form

Problem:
========
Some fieldName doesn't exist in the list of fields.

Solution:
=========
Swapped the values in the assign in duplicateDataPoint.

opw-3454514

closes odoo/odoo#134024

X-original-commit: 4ce57085b302957e2c260183f05f534160fa7ea4
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-04 09:19:15 +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
Samuel Degueldre 6580a435a9 [IMP] web: improve datetime picker support for time
This commit improves the support for time in the datetime picker by
doing two things:
 - allow to pick seconds by giving a rounding value of 0
 - check minDate and maxDate by accounting for the time when the picker
is in datetime mode instead of only checking the date

Part-of: odoo/odoo#133349
2023-09-04 09:19:08 +00:00
Jorge Pinna Puissant ebd538a194 [IMP] web, *: optimize save record from webclient
This commit, adds a new python method (`web_save`) to save a record, and
optionally read-it again in one rpc call. This optimizes the current
behavior that is to save a record in one rpc, and read-it in a second
rpc.

web_save, will receive the list of IDs of the records to save (if this
list is empty it will create the records, if not, it will write on the
existing records), the list of changed fields, and the unity
specification as optional argument to read the created/modified records
(if the specification is not set, the function will return a list of IDs
of the created/modified records).

closes odoo/odoo#133021

Task-id: 3453184
Related: odoo/enterprise#46559
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-04 09:19:06 +00:00
Khushi e38736df6e [FIX] web: de-duplicate icons in edit mode of binary field
In dashboard configuration, when you click on file of 'Data' section in
debug mode to edit, icons were duplicated.

This commit fixes the issue by getting rid of the same icons in
overridden template `web.ListBinaryField` from `binary_field.xml`
in order to remove icon duplicacy.

Additionaly, this commit removes unnecessary `<i>` tags and alters the
classes of `<button>` tags instead, to maintain the visual appearance
of icons (now they look the same as everywhere else).

Task ID : 3453198

closes odoo/odoo#134005

X-original-commit: 850e16cc415486507d1984ea08a04140ffba7c61
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-09-01 16:46:07 +00:00
FrancoisGe 9170f71d96 [FIX] web: fieldDependencies are readonly by default
The purpose of this commit is to make fieldDependencies are readonly by default.
This avoids making fields unintentionally editable. If the field is editable,
it will be sent during create/write, which is what we want to avoid.

Use case:
Go to a form view with 2 fields "a" which is readonly and "b" which has
"a" as fieldDependencies.

Before this commit:
    Record Datapoint thinks that field "a" is editable

After this commit:
    Record Datapoint thinks that field "a" is readonly

closes odoo/odoo#132247

Related: odoo/enterprise#46691
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-01 16:45:59 +00:00
Samuel Degueldre 8faef71242 [FIX] web: fix datetime picker disabling incorrect periods
Previously, if you specified a min or max date for the datetime picker
and zoomed out to the month/year/decade view, it would disable some
months/year/decade incorrectly, this was caused by the code checking if
the beginning of the period was in the min-max range instead of checking
if the period had any overlap with the min-max range.

This commit fixes that by checking for overlaps instead.

closes odoo/odoo#133911

X-original-commit: 7cb61dca99be4b0a1c35f0ec762c1bda318ec043
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-01 15:09:57 +00:00
Aaron Bohy d4448ade44 [REF] web: remove unaccent legacy utils
This utils also exists in /core/utils/strings and the legacy
version was no longer used. Also remove the diacritics map which
is heavy.

closes odoo/odoo#133896

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-09-01 15:09:52 +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
FrancoisGe 61307c162d [FIX] web: use evalContextWithVirtualIds for client expression
Before this commit, all python expressions in js were evaluated with
the same evalContext. Unfortunately, this is not possible for expressions
based on an x2many. The value of the x2many depends on whether the
expression will be sent to the server or not.

All expressions that are only used client-side, such as modifiers (readonly,
required, invisible), decorations, etc., must take virtual records into account.
For example, I define a button that must be visible when I have at least
one record in my x2many. So when I create my virtual record, I want
the button to become visible and not have to wait for the record to be
actually created.

For expressions sent to the server, such as domains and contexts,
we don't want them to take virtual records into account, as these are
not known by the server and could cause crashes.

Solution:
We have evalContext for expressions sent to the server
and evalContextWithVirtualIds for client-side expressions.

closes odoo/odoo#133718

Related: odoo/enterprise#46604
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-01 15:09:49 +00:00
Xavier Morel dd4b3c3a66 [IMP] web: simplify waitForCondition
`waitForCondition` is written in a rather old style with a recursive `setTimeout` to handle the delay / debounce between checks. The code is rather hard to follow, and unnecessarily so: the code can be rewritten as an iterative async function which is a lot simpler.

Important change: `waitForCondition` now immediately checks for the condition instead of waiting `interval` milliseconds before doing so.

This is because the conventional usage is for it to be preceded by an `await triggerClick`, which includes an `await
waitForNextAnimationFrame()`. As a result there are good odds the click has already been processed by the time `waitForCondition` runs.

closes odoo/odoo#133645

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-01 15:09:49 +00:00
Pierre Pulinckx (pipu) d128feafeb [FIX] web: add date for mobile week & month view
In this commit, current date is added in control panel breadcrums for calendar
week and calendar month views and this only for mobile screens.
If a week straddles two months then the two months are included in the wording
but in shortcuts (Aug-Sep 2023). In all other cases, the entire month and year
are included in the label (August 2023).

Task-3439201

closes odoo/odoo#133633

Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-09-01 13:20:59 +00:00
Pierre Rousseau 82697d0b18 [REF] web, *: remove owl2 compatibility
*: mrp_subcontracting, point_of_sale, project, web_editor, website,
website_slides

Part of task-id 3439226

closes odoo/odoo#133551

Related: odoo/enterprise#46526
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-01 13:20:56 +00:00
Pierre Paridans fedecc1f27 [IMP] web,*: remove unused legacy download.js
task-3439226

closes odoo/odoo#133768

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-31 14:15:07 +00:00
Pierre Paridans 31a00125de [IMP] web,*: remove unused legacy content-disposition.js
task-3439226

Part-of: odoo/odoo#133768
2023-08-31 14:15:07 +00:00
Levi Siuzdak (sile) b5c595e0aa [FIX] web: fix list view when grouping rows that start with numbers
Versions:
---------
- saas-16.3
- saas-16.4

Steps to reproduce:
-------------------
1. go to a list view which starts with a numerical value;
    - e.g. with developer mode enabled:
        Settings > Technical > Scheduled Actions
2. group by any element.

Issue:
------
The width of the `o_group_name` elements is around 40px, not enough for
the names to be displayed.

Cause:
------
`list_renderer.js` calculates the `colspan` of `o_group_name` elements
based on the first occurence of a value that can be aggregated, i.e.
any numerical value. If this happens to be the first column, the
`colspan` is set to 1, leading to their width being the same as the
first column containing checkboxes. An update in saas-16.3 had forcibly
set these to 40px by adding the `!important` rule:

```scss
.o_list_record_selector {
    width: 40px !important; // Force to 40px regardless by the font-size
}
```

Solution:
---------
After consulting the person who introduced the rule, we agreed that
removing it would be the easiest fix, unlikely to introduce any new issues.

opw-3459598

closes odoo/odoo#133521

X-original-commit: c89c94192685c989b65eb6b483b4120aa312252c
Signed-off-by: Levi Siuzdak (sile) <sile@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2023-08-31 14:15:01 +00:00
Pierre Pulinckx (pipu) ce38e06801 [REF] *:replace moment usages with luxon
luxon and moment are both used in the solution, but these two libraries
facilitate the manipulation of dates. It was decided to replace all uses of
moment with luxon so we can then remove moment.js from the code and lighten
the assets.

task-3391739

closes odoo/odoo#133144

Related: odoo/enterprise#46447
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-08-31 14:14:59 +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
Aaron Bohy 7da60e7d9a [REF] web: remove unused legacy fn from action service
This function became useless at some point, after the views and
actions have been all converted to owl.

closes odoo/odoo#133699

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-08-31 10:37:08 +00:00
Aaron Bohy 2a121a32a2 [REF] *: rename unity_web_search_read into web_search_read
Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Aaron Bohy 1d71e35cde [REF] web: remove old web_search_read
as it will be replaced by unity_web_search_read

Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Aaron Bohy 986c00c1bd [REF] web,*: always use unity_web_search_read
*project,spreadsheet

The unity version of web_search_read will soon replace the older
one, so this commit prepares the work by adapting the remaining
calls to web_search_read s.t. they call unity_web_search_read
instead.

Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Aaron Bohy 660cde4298 [FIX] web: SampleServer: properly mock unity_web_search_read
Before this commit, many2one values were still returned as pairs
of id and display_name by unity read, whereas they should be
objects with keys id and display_name.

Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Aaron Bohy 573516e9c1 [REF] web,board: remove /web/dataset/search_read
Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Christophe Monniez 2f5d67471b [IMP] web: speedup the clickbot
closes odoo/odoo#133630

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-08-31 06:16:01 +00:00
Pierre Paridans f0a73e51bd [IMP] web: remove unused rules for .o-{not}-collapsed-label
task-3439226

closes odoo/odoo#133289

Related: odoo/enterprise#46381
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-31 06:15:55 +00:00
Pierre Paridans d9a12fe7cf [IMP] web: remove unused model_field_selector.scss
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 37c6dfa936 [IMP] web: remove unused rules for .o_legacy_field_widget
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 24ce8bf066 [IMP] web: remove unused legacy rules in ui.scss
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 0776f2465c [IMP] web,*: split {non-}legacy ui.scss
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 73f2d5d8fd [IMP] web: split {non-}legacy modal{_mobile}.scss
And normalize the responsiveness of the modal between Community &
Enterprise.

task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 05f7404066 [IMP] web: remove unused .o_toggle_button_success
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans e9e31bfbc2 [IMP] web: remove unused legacy templates
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans cc2bfdbf42 [IMP] web: remove root_widget
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 1b1b9cc0aa [REF] web: split {non-}legacy rules in fields.scss
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 2d99580059 [IMP] web: remove legacy dropdown css
Adapt SearchBar accordingly to properly keep the highlight effect during
keyboard navigation (cf. removed comments in dropdown.scss).

task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 8bbe70433d [IMP] web,*: remove unused .o-dropdown-menu class
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans d629aa0a6a [IMP] web: remove unused .o_inline_dropdown class
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans f44e96c73c [IMP] web: removes fields_extra.scss
And normalize styles between Community & Enterprise.

task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans 6c2764a753 [IMP] web,*: remove legacy o_field_many2manytags class & styles
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Raphael Collet 132e9f72ed [REF] *: rename onchange2 to onchange
closes odoo/odoo#133049

Related: odoo/enterprise#46240
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-08-31 05:11:44 +00:00
luvi c6e0846318 [FIX] web: buttons with special attrs close dialogs
This commit fixes the behavior of those customized buttons, used in
form view footers, aiming at saving/discarding the changes. The expected
behavior is that the dialog closes itself when those buttons are pressed,
which was no longer applied since the rewrite of views in Owl.

Also, the newly created value was not selected after saving the record.
Now, it selects it immediately if a button with special="save" has been
pressed.

A test has been added to verify that dialogs behaves correctly and close
themselves when clicking such buttons.

task-3254368

closes odoo/odoo#133602

X-original-commit: 331c2904e566cc74c46a097b2b1abe79b50d8672
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-30 23:45:43 +00:00
Louis (loco) 83616825ce [FIX] web, web_editor: restore the use of throttled calls
Since [this commit], some throttle calls have been replaced by debounced
calls. This commit modifies those calls in three cases.

The first case is to adapt the overlay covering when the window is
resized or content changes. Note: to reproduce the problem, you might
have to use a test tour for example, as the last operation has to be
done really quickly.
Steps to reproduce the problem:
- Go on a product page.
- Double click on the product image and replace it by one of your own.
- Quickly click on the "Remove" button to remove the product image.

-> Problem: In the `ReplaceMedia` option, the call to `destroy()` (due
to the change of target) is done after the call to `removeMedia()`.

A race condition appears here as since [this commit], the function
`updateCurrentSnippetEditorOverlay()` (responsible of the destroy of the
options whose `$target` are not in the DOM anymore) is debounced and not
throttled anymore. This is a problem for two reasons:
- We do not want the first call to the function to be deferred.
- We want this function to be executed at least at a certain rate if
there are a lot of `content_changed` events recorded in a short period
of time.

This commit also removes the call to a debounced version of a function
at a `mouseup` event in the context of the `ColorpickerWidget`. Indeed,
while the use of a debounced or a throttled version of a function is
totally justified at a `scroll` or a `mousemove` event, it is not in the
case of a `mouseup` event as the occurrence of this kind of event can
not be very high over a give time period.

Finally, this commit restores the use of a throttled version of the post
animation cover.
This can be justified by the fact that we want the post animation cover
function to be executed at least at a certain rate if there are a lot
transition or animation end events recorded in a short period of time.

[this commit]: https://github.com/odoo/odoo/commit/f4f0f783183507df8227b37fe1234c256325df6d

task-3111601

X-original-commit: 4c9eb9589e81b02945618195fbe12a4dd0ab9a50
Part-of: odoo/odoo#133546
2023-08-30 13:10:23 +00:00
qsm-odoo 2cff7e4094 [FIX] website, *: restore cc edition widgets and other qweb rendering
*: web, website_sale_stock

Since [1], the widgets allowing to edit the different colors of a color
combinations are gone, except the first one. This is because the qweb
rendering calls have been modified to use the new `renderToElement` util
which silently ignores root nodes if there are multiple ones in the
rendered template. In the same way, a specific dynamic snippet and a
stock feature were also broken.

After this commit, those three features will be restored. A crash will
now also occurs in case `renderToElement` is called to render a template
with multiple root nodes (that is actually how the two last broken
features were found, breaking during existing tests). For the first
feature, a specific test has been made too.

[1]: https://github.com/odoo/odoo/commit/6303a3eacdca012649a2ffda627b65c17a7217f1

closes odoo/odoo#133068

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-08-30 13:10:21 +00:00
Aaron Bohy f65fdd01f2 [REF] web: remove LegacyAdaptedActionDialog
This component was necessary during the transition phase, when all
actions weren't converted to owl yet. Now, they are, so we can get
rid of this small compatibility layer.

Part of task~3439226

closes odoo/odoo#133489

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-30 11:49:01 +00:00