Commit Graph
4044 Commits
Author SHA1 Message Date
Jorge Pinna Puissant 52e20a3dd3 [REF] web, *: change name noReload to reload
This commit change the name of the option noReload to reload, this is to
avoid having negative variables names for boolean. This is a general
known best practice, and in this case it's important to have a better
readability of the code (specially when a negation of a negative
variable occurs).

closes odoo/odoo#134317

Related: odoo/enterprise#46913
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-06 10:25:59 +00:00
Aaron Bohy e6fde6b694 [FIX] web: apply correct limit when grouping list/kanban
Be in an ungrouped list or kanban view. The "limit" number of
records is displayed (by default 80). Apply a group by. The same
limit is applied for the number of groups, whereas there's a
specific parameter ("groups_limit") for the number of groups to
fetch and display. The same problem occurs the other way around
(going from grouped to ungrouped), as in this case the groups_limit
is kept when the view is no longer grouped.

This commit fixes the issue by forcing a reset of the limit when
we go from grouped to ungrouped and from ungrouped to grouped.

We also add a test to ensure that the "groups_limit" is taken into
account even when there're multiple groupbys, which wasn't the
case in previous versions, but which is working as expected with
the new model.

closes odoo/odoo#134253

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-05 21:18:19 +00:00
FrancoisGe 956393ab90 [FIX] web: clean input m2mTagsAvatar
Before this commit, performing a search in a Many2manyTagsAvatarFields
and selecting an element does not remove the search value from the input.

Why not?
The value passed to Autocomplete is the default ''.
As this value never changes, onWillUpdateProps is never called and cannot
empty the input.

Solution:
Use the resetOnSelect option to force the input to be reset at each select
if props.value is the default value.

closes odoo/odoo#134242

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-05 21:18:17 +00:00
FrancoisGe d8f03151fa [IMP] web: add relatedFields in x2m sub-views
The goal of this commit is to allow relatedFields to be added to a one2many
field using a sub-view.

Before this commit, if an x2many custom contains a sub-view and relatedFields,
we ignore the sub-view and use only the relatedFields.

Now we're going to add the relatedFields to the fields/activeFields
defined in the sub-view.

Use case:
Created a custom x2many field dependent on the 'display_name' of
a many2one field that should not be present in the sub-view. For example,
to simulate a groupBy on this many2one field.

closes odoo/odoo#132351

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-05 19:58:01 +00:00
Antoine (ande) 12c6eb017c [FIX] web: textarea do not resize properly
Current behaviour:
When clicking on a note containing
multi-line text, the textarea shrinks

Expected behaviour:
Note should show whole text

Steps to reproduce:
1. Install sale_management
2. Head to Sales > Quotations
3. Click on any quotation line
4. Click on "Add a note"
5. Input multi-line text
6. Click on the "Save manually" button
7. Click again on the note
8. Note is omly one character tall

opw-3457234

closes odoo/odoo#134231

X-original-commit: 061430f1430723d719230796774cf4efab8aa348
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2023-09-05 16:34:41 +00:00
Jorge Pinna Puissant f609a616d1 [IMP] web: allow to save and read next record in one rpc call
In [1], a new python function was introduced that allows to save and
read in one rpc. This commit, adds the possiblitity to read another
record in the same rpc call. This is particularly useful when you want
to save and read the next record (for instance on a pager).

1: ebd538a194

Task-id : 3453184

closes odoo/odoo#134125

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-05 12:22:19 +00:00
Sébastien Theys 7a9581e1f3 [REF] web, mail, im_livechat: tests: remove afterNextRender
Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Aaron Bohy 38d0124a93 [FIX] web: correctly eval context for nested x2many
Have a form view with a one2many field (e.g. displayed as a list)
containing itself an x2many field (e.g. many2many_tags), with a
dynamic context depending on the parent record (see the test for
a specific situation).

Before this commit, the dynamic context on the inner x2many wasn't
correctly evaluated, because when we evaluated it, the parent
evalContext hadn't been computed yet (they were computed bottom-up)
when the datapoints were created.

With this commit, we wait for all datapoints and evalContext to be
properly set up before evaluating the static list dynamic contexts.

closes odoo/odoo#134160

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-04 17:10:11 +00:00
FrancoisGe c0b6322e25 [IMP] web: add alwaysApply in useDebounce
The purpose of this commit is to add the alwaysApply option to useDebounced.
This option is used to force execution of the callBack if the debounced
function has been called and is still not resolved when the component is destroyed.

closes odoo/odoo#134096

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-04 17:10:09 +00:00
Damien Bouvy 180de8afe6 [IMP] web, *: replace view all with search more
This partially reverts commit da50ce31ae825ef9f4b527553a2e2caec970d290.

Whilst the behavioral changes done in the task are correct, the wording
is not optimal and was better understood by users before this change.

Task-3483936

closes odoo/odoo#133511

Related: odoo/enterprise#46503
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-09-04 17:10:05 +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
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
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
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
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
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 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
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
Pierre Pulinckx (pipu) 4a5437032b [ADD] web: human readable integer field
Allow developers to format integers/float
using "human_readable" options for integer
field (e.G. 500G instead of 500,000,000,000)
Use decimals options to choose how many float
number are displayed.
Let's see in unit test for examples.

task-3418678

closes odoo/odoo#130402

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-08-30 09:25:09 +00:00
Aaron Bohy 7736259e6c [FIX] web: can create record in list view grouped by m2m
Before this commit, in an editable list view grouped by a many2many
field, it crashed when the user tried to add a new record, because
the default value set in the context was wrong (it was an id, but
it must be a list of ids, containing a single id, the one of the
group where we want to create a record).

As this is a master fix, this commit takes the shot to refactor a
bit the way we extract information from groups returned by
webReadGroup, s.t. everything is now computed directly (before,
the serverValue was computed in the datapoint, which didn't allow
us to use it in the context). We can also get rid of the context
handling in kanban (where the bug wasn't present), as it is now
correctly generated in the model for everyone.

closes odoo/odoo#133420

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-30 07:03:59 +00:00
Aaron Bohy f065276a46 [FIX] web: tests: click helper: throw error if target is disabled
Before chrome 116, programmatic clicks on disabled buttons weren't
actually fired. With chrome 116, they are. As a consequence, some
tests fails on chrome 116 because they click (on purpose) on
disabled button to highlight the fact that nothing happens.

This commit improves the click helper to make it throw an error
when the target is disabled. It also adapts the tests that were
clicking on disabled button, in general to simply assert that the
button is disabled instead.

closes odoo/odoo#133196

Related: odoo/enterprise#46398
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-29 11:10:50 +00:00
Michael (mcm) 1f5e8f0fd4 [IMP] web,*: remove web.session
This commit removes the legacy session and adapts the modules where it
was used.

task 3439226

closes odoo/odoo#133153

Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-29 11:10:47 +00:00
Michael (mcm) 629a046e03 [IMP] web,*: empty services/core.js
This commit removes almost all exports of the module services/core.js
(only the bus is left) and adapts the module that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Michael (mcm) 55f1822911 [IMP] web,*: remove services/config.js
This commit removes the module services/config.js and adapts the module
that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Jorge Pinna Puissant 4bf77b9ef1 [REF] web: RelationalModel: add option to save after update
This commit adds an option to save the record after an update. When the
save option is set to true, the record will be saved and reload after
the update. Note that, the onChange is not done in this case.

Part-of task-id~3179751

closes odoo/odoo#130328

Related: odoo/enterprise#44905
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-29 11:10:45 +00:00
Pierre Rousseau 258e6a019a [IMP] web: allow to open a record in editable list
With this revision, it's now possible to display a button to switch from
an editable list view to a form view. It's possible by adding the
attribute open_form_view to the tree element in the list definition. It
works both with base and embedded list views.

Task-id 3063425

Part-of: odoo/odoo#116989
2023-08-29 11:10:42 +00:00
Bastien (bvdn) ee52f87a36 [IMP] web: add hooks to calendar controler, fix css for filterPanel
- For the Planning app calendar we now need to be able to fetch specific fields from the filters record
we don't want to inherit the whole loadDynamicFilterSection method so we created an addFilterFields method
used to fetch specific fields from the record accroding to the filterInfo ()

- we also need to display specific text when creating a new record from the calendar view, for exemple in calendar 'New Shift'
rather than 'New event' but we don't need to override the whole editRecord() method so we created a getter: editRecordDefaultDisplayText()

- For the css files, we lowered a bit the checkmark icon in the filters, and we added a new class that prevents the icons background
to become invisible when the filter checkmark isn't changed

Task-3251698

Part-of: odoo/odoo#126358
2023-08-29 09:11:52 +00:00
std-odoo 1008383d9e [IMP] web: allow to drag and drop properties
Purpose
=======
Allow to drag and drop properties to re-arrange them. Also allow to drag
and drop an entire group of properties by drag and dropping the
separator of the group.

Specification
=============
If we have no groups, and we move properties, we want to create
automatically new groups in order to keep the column separation.

So if we have
```
AC
BD
```

and you move B in the second column, we will create 2 groups to keep
the separation, so it will become
```
12
--
AC
 D
 B
```

so `C` stay in the second column.

Task-3188915

closes odoo/odoo#113974

Related: odoo/enterprise#37668
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-29 09:11:51 +00:00
std-odoo 29c7b23e22 [IMP] base, web: add the "separator" properties type
Purpose
=======
Add the "separator" properties type, to be able to group properties.

Specification
=============
The separator creates a group until the next separator, we can fold and
unfold the properties in a group.

Technical
=========
The separator is only stored on the definition record, so it does not
take more space than needed.

The "fold" information is stored in the local storage, and is therefore
per user, but shared for all records of the same parent.

We use a properties type for it, to be able to use the exact same code
as other properties (so we can easily move the separator, etc). So
the order of the properties in the definition, and the position of the
separators will create the groups.

Task-3188915

Part-of: odoo/odoo#113974
2023-08-29 09:11:51 +00:00
Aaron Bohy 1da9684ddf [FIX] web: kanban grouped by many2one: keep false group open
In a kanban (or list actually) view grouped by a many2one field,
the "false" group is folded by default. Before this commit, if the
user opened it and then reloaded the view (e.g. by applying a
filter in the search view), the group was folded again. With this
commit, the group remains open if the user manually opened it.

closes odoo/odoo#133305

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-08-29 07:48:13 +00:00
Aaron Bohy 049fe6f9ed [FIX] web: multi level grouped list: do not consider empty
Before this commit, when a list view was grouped by more than 1
field, the view was considered empty, and the no content helper
was displayed. For instance, go to Contacts and group by Company
and Country.

Part-of: odoo/odoo#133305
2023-08-29 07:48:13 +00:00
Jorge Pinna Puissant 0fd1790fb5 [FIX] web: kanban column counter when grouped by a date
Before this commit, if the kanban was grouped by a date field, and have
an aggregate, the column counter was always 0.

Now, the column counter has the correct value.

closes odoo/odoo#133114

X-original-commit: ea3809a480c29eafd6ab8433d5ae0e378b1d9967
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-25 18:49:30 +02:00
Jorge Pinna Puissant b1829d906b [REF] web, *: remove legacy MutexedDropPrevious
In our continued effort to remove legacy code, this commit replaces
the unique usage of the legacy MutexedDropPrevious util with the new
mutex util. The legacy MutexedDropPrevious has been removed.

Part-of task-id 3439226

closes odoo/odoo#132948

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-25 12:20:53 +02:00
Pierre Rousseau 2d9f6fb324 [REF] web, *: remove legacy registry
*: website, website_slides

Part of task-id 3439226

closes odoo/odoo#133132

Related: odoo/enterprise#46272
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-25 10:59:55 +02:00
Aaron Bohy 122ff3ca59 [FIX] web: correctly leave sample mode in grouped kanban
Have a grouped kanban view with sample data and existing groups,
and the quick create feature enabled (e.g. CRM pipeline). Click on
"New", or on the "+" of a column. Before this commit, all columns
displayed the "Load More" button, with the count of sample records
that had been generated for that column, even though the columns
were empty. After this commit, no "Load more" button is displayed,
as expected.

closes odoo/odoo#132802

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-23 12:30:57 +02:00
Aaron Bohy ecb41753b6 [FIX] web: add record in list with sample data: no flickering
Have an editable list view with sample data (sample="1" and no
record). Before this commit, there was a flickering when the user
clicked on "New" to add a record. Indeed, the list was first
re-rendered without the sample mode (i.e. without the opacity style
and no content helper), but still with the sample records. With
this commit, we wait for the reload to be done before leaving the
sample mode, s.t. when the list is re-rendered, we don't have
sample records anymore.

Part-of: odoo/odoo#132802
2023-08-23 12:30:56 +02:00
Tom De Caluwé 4163f1f4ff [FIX] web: prevent inline x2many list view overflows
When using a list view for an x2many field in a form view, the parent node
containing the list view will adapt its size to its contents. This can be a
problem for the list renderer as it calculates the allowed total table width
from the width of the parent node.

To resolve the issue we make sure the table does not cause any overflows at the
moment the allowed width is computed, just before the calculation of the column
widths.

Steps to reproduce:
Go to Inventory > Inventory Adjustments > Select a product from a line

In the many2many additional_product_tag_ids add a tag with a name longer than
the width of the column. Now all the labels in the column are broken (they will
wrap after every character).

opw-3358116

closes odoo/odoo#132759

X-original-commit: 1fa97b5a814ca678b831ef0545fd5a24f577c979
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Tom De Caluwé (tdc) <tdc@odoo.com>
2023-08-23 11:12:49 +02:00
Jorge Pinna Puissant 5d3e919b02 [REF] web, *: remove legacy DropMisordered
In our continued effort to remove legacy code, this commit replaces
usage of the legacy DropMisordered util with the KeepLast util. The legacy
DropMisordered has been removed.

Part-of task-id 3439226

closes odoo/odoo#132559

Related: odoo/enterprise#46027
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-23 11:12:28 +02:00