Commit Graph
3964 Commits
Author SHA1 Message Date
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
Khushi 98218629f8 [IMP] model_selector: modified related model dropdown behaviour
Before:
When number of available domains exceeded the display limit, user was
unaware of the other available domains as nothing in UI indicated so.
Visible entries change only when user starts typing something.

After:
This commit adds a 'Start typing...' entry after visible models in
dropdown menu whenever number of available models exceed the display limit,
in order to provide a hint to the user.

When user starts typing, 'Start typing...' entry disappears and all available
domains are displayed with a scrollbar.

Task ID : 3375332

closes odoo/odoo#126156

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-08-10 17:01:38 +02:00
Nicolas Bayet 645b6b2c10 [FIX] web_editor: properly fetching of colorpicker template
As described in #129974, the colorpicker cannot cache a promise
protected by `useService`. #129974 fixes the issue by through non
idiomatic practice (calling a service that is not protected by
`useService`). This commit fixes the issue idiomatically.

This commit caches the promise directly from a service and removes the
caching code from the `ColorPalette`.

task-3446691

closes odoo/odoo#130789

X-original-commit: 1d2e54088b0f0e28464ab6aa884fb2e1110e8e04
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-08-10 06:17:03 +02:00
FrancoisGe c7524e2d8b [FIX] web, *: record key is reactive in KanbanRecord
Before this commit, calls to record[fieldname][value/raw_value] in
the arch of a kanban view did not take into account updates on the Record
Datapoint. So if any data in the Record changed, the [raw_value/value]
was not modified.

In a custom KanbanRecord, you should never use the record containing the
value and raw_value. We will therefore replace this call by using the
datapoint record directly.

How to reproduce:
    - Have a kanban view with a record.my_field.value and a widget allowing
        you to modify the value of my_field.
    - Click on the widget

Before this commit:
    The value of my_field does not change

After this commit:
    The value of my_field has been updated.

closes odoo/odoo#131165

Related: odoo/enterprise#45413
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-09 03:08:00 +02:00
Pierre Pulinckx (pipu) b1ebe3b6f4 [REF] *: Replace core._t imports
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
 web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.

task-3292454

closes odoo/odoo#130865

Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-09 00:13:08 +02:00
Hubert Van de Walle (huvw) f603e86959 [FIX] project, web: create_group compatible with custom _rec_name
Steps to reproduce
==================

- Enter studio
- Create a new app
- Create a new model with "pipeline stages" enabled
- Close studio
- Switch to the kanban view
- Add a new stage

`ValueError: Invalid field 'name' on model 'x_test_stage'`

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

A model _rec_name is not always name. This is the case for example with
studio stages. In that case,  `_rec_name == 'x_name'`.
Since [commit], we do a create instead of a name_create.

Solution
========

First do a name_create to handle custom _rec_name. Then if there is
still some field to be written, do a simple write.

[commit]: 4e974e5

opw-3432017

closes odoo/odoo#130921

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-07 19:57:54 +02:00
Michael (mcm) 00d8aef1c7 [REF] web, *: remove legacy patch
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.

closes odoo/odoo#130867

Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-07 10:58:48 +02:00
Aaron Bohy 6774530101 [REF] web,*: remove KeyboardNavigationMixin from website
This mixin was still applied on the RootWidget but was useless
since the website relies on the hotkey service [1].

This commit ends the life of the frontend_legacy asset.

[1] https://github.com/odoo/odoo/commit/daf5963845a8dda4d669e512a4ef6dcfebdd8813#diff-fe005825c9360edbc616517111aa67926161221c42003cad29f88a0214cd909eR13

Part of task~3439226

Part-of: odoo/odoo#130843
2023-08-04 16:34:50 +02:00
Jorge Pinna Puissant 8a89676f2c [FIX] web: renderToElement should always returns an element
Before this commit, when the first element of a template is a non
fulfilled condition :
'<t t-if="false"/>'
The function renderToElement returns an empty text. This occurs because
it returns the first child, which in this case is an empty text.

Now, the function returns the first element.

closes odoo/odoo#130858

X-original-commit: 8dabc4e1d5ebd94f6a315ce56b9bf60240dd7fdd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-04 15:02:42 +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
Aaron Bohy 850427e4ba [REF] web,mail: remove legacy MockServer and related utils
This commit removes the legacy implementation of the MockServer
and test utils making it available in the test environment (e.g.
addMockEnvironment).

Part of task~3439226

closes odoo/odoo#130671

Related: odoo/enterprise#45141
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-08-04 09:43:08 +02:00
FrancoisGe 41750141c2 [FIX] web: drag and drop kanban flicker
Before this commit, in a kanban view, if you resequence records or
groups by dragging and dropping, there is a flicker.

How to reproduce:
- Go to a kanban view
- Drag and drop a kanban card

Before this commit:
    The moved kanban card returns to its previous position during a render.

After this commit:
    The kanban card keeps its new position.

closes odoo/odoo#130561

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-04 09:42:58 +02:00
tong-odoo 24edd423dd [FIX] web: list.binary field should show filename
Steps to reproduce:

- Make any list binary field with filename attribute

Current behaviour:

- The binary file does not use the filename field

Expected behaviour:

- The binary file should use the filename field

Explanation:

After the updates of list-specific binary field [1], the list
binary cannot get the attributes field name of the record anymore.

[1] odoo/odoo#129631

closes odoo/odoo#130719

X-original-commit: ddfa65782a8ff59c07adcb8c56797c57a06789a0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-03 19:31:59 +02:00
Antoine (anso) 46363b1dc0 [FIX] web: form statusbar margin
Prior this commit, there was an undesirable margin under
`.o_form_statusbar` when on mobile

part of task-3355071

Forward-port-of: https://github.com/odoo/odoo/pull/126646
Part-of: odoo/odoo#130616
2023-08-03 19:31:35 +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
Jérémy Hennecart (jeh) 2c11e734f8 [FIX] web: fix empty html field
Markup("") on a HTML field should be counted as an empty field.
Check now the length of the value and assign false for HTML field
if we have an empty string inside markup.
This was leading to an issue where empty alert message were displayed
based on computed HTML field.

closes odoo/odoo#130479

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-03 10:43:15 +02:00
Aaron Bohy f31214aeaa [REF] web,*: remove legacy fields
Those fields are no longer used since all client actions and the
studio report editor have been converted to owl.

Part of task~3439226

closes odoo/odoo#130462

Related: odoo/enterprise#45015
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-03 09:23:21 +02:00
Michael (mcm) 9d6b380a24 [REF] *: adapt patches after new patch function
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.

task 3410198

[1]: 19ea1ac08043e22a811630968e44715cc3bfc495

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Michael (mcm) 04fddc19d4 [IMP] web: improve patch function
This commit refactors the patch function in order to simplify its code
but also and most of all remove the `this._super` bound on each patched
method call.
The patch function now supports the javascript keyword `super` to
get the parent's property.
This removes constraints we had with `this._super`. We had to create a
rather complicated intermediate function to bind `this._super` and this
function was called each time before we called a patched method.
It was annoying for debugging but necessary. Because of this
intermediate function `this._super` was also had to re-bind each time
we entered a patched method which was annoying with async method, we
had to save the parent method in the patch before awaiting its
execution. Finally, not a big issue but still, objects could not have a
`_super` property as it would be hidden in the patch.

task 3410198

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
FrancoisGe ce774f1322 [FIX] web: complete x2m activeField
The goal of this commit is to complete the list of activeFields for
an x2many in list mode when a record is opened with the fields present
in its form view. This ensures that there is always an activeField
for all the data in a record. Before this commit, when the x2many's
form view was not inline, when the form view was closed, the fields
not present in the list view no longer had an activeField, which could
cause crashes.

closes odoo/odoo#130453

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 16:00:01 +02:00
Jorge Pinna Puissant fa5c70d61d [REF] web: RelationalModel: unity always return an object for many2one
Before this commit, in some cases (many2one invisible) unity returned
an integer as value.

Now, to be consistent, unity always return an object for many2one.

Note that, web_read_group still returns an array as value for many2one.

part-of task-id~3179751

closes odoo/odoo#130340

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 13:20:30 +02:00
Julien Carion (juca) 6da48dbc95 [IMP] web: add show weekends to calendar
This commit adds the "show weekends" functionality to calendar which
allows the user to choose whether weekends should be shown in the calendar
or not (defaults to false).

task-3425523

closes odoo/odoo#129107

Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-02 13:20:07 +02:00
Samuel Degueldre c4b7d65e2e [FIX] web: stop leaking event listeners on EventBus in QUnit suite
In odoo/odoo#120893, the mail team changed their test utils so that they
would always start all services. This can cause issues because services
do not have any built-in destruction/cleanup mechanism, as in a
production application they are only supposed to be started once. Some
services add event listeners on global objects, in particular, the
tour service adds an event listener on the tour registry which is
global. If this event listener is not cleaned up, every time the tour
service is started, a reference to the environment in which this tour
service is being started is leaked. Since the environment contains all
started services, it is typically a pretty heavy object, especially
since in this context, all services are started instead of a select
subset.

This commit fixes that by patching the EventBus class to automatically
remove event listeners that were added on an event bus after the test,
in a similar fashion to what we do for some global objects like window
or the document's body.

closes odoo/odoo#130373

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 06:18:09 +02:00
Aaron Bohy c10b5d0b1b [REF] web,*: tests: remove legacyExtraNextTick
Now that most of the webclient codebase (fields, views, client
actions...) has been converted to owl, the legacy extra next tick
used in a lot of tests is no longer necessary. This commit removes
the helper and its usage. At some places, a real tick was needed,
but we didn't see it because of the use of the legacy extra next
tick.

Part of task~3439226

closes odoo/odoo#130236

Related: odoo/enterprise#44869
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-01 23:52:30 +02:00
Pierre Pulinckx (pipu) 60fe2e9b17 [REF] *: remove _lt()
In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().

task-3292454

closes odoo/odoo#130179

Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-01 13:51:17 +02:00
Samuel Degueldre 8f68a146bf [IMP] web: check for undesirable module dependencies
Previously, we have accidentally made some core modules depend on some
modules outside of the core folder (eg views), this is undesirable as it
can make assets bundle hard to write using globs, and can make it easy
to introduce circular dependencies, it also doesn't make sense from a
code-organisation perspective.

This commit introduces a QUnit test that checks the modules in some
folders only depend on other whitelisted folders.

closes odoo/odoo#129982

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 20:54:01 +02:00
Pierre Rousseau 036307ba26 [REM] web, *: remove legacy dialog
OwlDialog is not used anymore, therefor we can remove it.

Task-id 3439226

closes odoo/odoo#129774

Related: odoo/enterprise#44634
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 19:02:58 +02:00
Pierre Rousseau 72dbb75d4d [REF] web, barcodes: remove legacy dialog
This commit replaces the legacy dialog by the new one.

Part of task-id 3439226

Part-of: odoo/odoo#129774
2023-07-31 19:02:57 +02:00
std-odoo dab3771377 [IMP] web: allow to drag-and-drop properties selection options
Purpose
=======
Allow drag-and-drop properties selection options in order to
re-arrange them.

Task-3338157

Part-of: odoo/odoo#123216
2023-07-31 19:02:28 +02:00
std-odoo 9348dfd70d [IMP] web: properties selection, insert after the focused option
Purpose
=======
Currently, when we want to add a properties selection option, we need
to focus another option and press enter. This will add the new option
at the end, but we want to add it just after the focused option.

Task-3338157

Part-of: odoo/odoo#123216
2023-07-31 19:02:28 +02:00
FrancoisGe fd98a3f4a0 [FIX] web: uses the right activeFields based on the view of an x2m
This commit allows the correct activeFields to be used depending on the
view used to open an x2many field.

Before this commit, if we had an x2many field with a list view and a form
inline view with the same field containing a different context depending
on the view. The context of the form view will always be used.

This is a problem:
If we have an inline form view with fields common to the list view,
the context of the activeFields in the form view will always be used
and we will try to combine the different modifiers (required, readonly, etc.).
We don't want to do this, we want to use the activeFields of the list view
when we open the record in the list and the activeFields of the form view
when we open the record in the form view.

Solution:
When we create the activeFields, we'll use the activeFields from the
list view and complete them with those from the form view. We will
therefore no longer replace or merge them.
Then, when we open a record in form view, we'll use the activeFields
from the form view and when the form view closes, we'll restore the
activeFields from the list view.

closes odoo/odoo#129989

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 16:11:13 +02:00
Odoo's Mergebot 5a9fe7a7d0 temp rebasing PR 129864 (5cf55f7f33) 2023-07-31 16:11:02 +02:00
Jorge Pinna Puissant 5cf55f7f33 [FIX] web: Kanban progressbar update count after domain change
- open a grouped kanban view with progressbar;
- select a progressbar;
- the records are filtered and the count/aggregate is updated;
- change the filter/domain that will reduce/increase the filtered
  records.

Before this commit, the records are correctly update but the
count/aggregate is not update.

Now, the count/aggregate of a selected progressbar is updated if the
domain changes.

task-3422009

X-original-commit: 95a94e0d928729bbbc80a627f816f9e575121f8d
2023-07-31 09:36:15 +02:00
Julien Carion (juca) 3af4bffeee [IMP] web, mail, hr: Avatar card preview
This commit adds the possibility to see additional information about a
user with a card that appears when hovering avatar user fields for a
set amount of time. This card contains the following information:
- Avatar
- Chat status
- Name
- Email
- Button to send message
and with HR installed:
- View profile Button
- Job position
- Department
- Phone number
- Advanced chat status (when hr_holidays is installed)

Task-3167110

closes odoo/odoo#121943

Related: odoo/enterprise#44563
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-26 19:18:49 +02:00
Aaron Bohy cf4e844aca [REF] web,*: remove legacy DataManager
The DataManager is no longer used as all views and models have
been converted to wowl.

Part of task~3439226

closes odoo/odoo#129725

Related: odoo/enterprise#44611
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-07-26 13:22:13 +02:00
Aaron Bohy f40d4dc98b [REF] web,*: remove some legacy test helpers
Part of task~3439226

Part-of: odoo/odoo#129725
2023-07-26 13:22:12 +02:00
Hubert Van de Walle (huvw) f478310d17 [FIX] web: prevent rollback in ace_field
Steps to reproduce
==================

- Enable debug mode
- Go to Settings / Technical / Automation / Automated Actions
- Set "Action To Do" to "Execute Python Code"
- In the code editor, type really quickly

The code is briefly focused and when the next input is processed,
everything is erased.

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

The AceField makes a debounced commit with the current editor value.
This triggers an onChange event, and upon receiving the results,
we update the editor value with the resolved value.
Although the editor value may have changed in the meantime,
we still revert it to the previous value.

Solution
========

There is no need to update the record every 10ms. We can simply to that
on blur. This is also what was done in 16.2.

opw-3379740

closes odoo/odoo#129694

X-original-commit: 4047ed03117fbcd5634843e29dc82e7ffb71b910
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-07-26 13:22:09 +02:00
FrancoisGe c011eaea59 [FIX] web: create kanban column groupBy x2many
Before this commit, in a kanban view grouped on a x2m, when we created
a new column, we had a crash.

Why did this happen?
When a column is created, a resequence is triggered on the columns in
order to have the correct position. Currently, we always use the
DynamicGroupList handle field, which is not correct because if we are
grouped on an x2m we use another resModel, so we want to use the default
handle field (sequence).

closes odoo/odoo#129510

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-26 09:21:59 +02:00
FrancoisGe a70442ae2c [FIX] web: o2m save dialog form and discard main form
Before this commit, discard management was incorrect when you had a
non-editable x2m. This could result in changes not being completely undone.

How to reproduce:
- Go to a form view with an uneditable x2m
- Click on a record in the x2m
- Edit the record in the form view dialog
- Click on save
- Reopen the same record
- Click on discard
- Click on the discard in the main form view
- Reopen the same record

Before this commit:
    The change applied is still present

After this commit:
    The applied change is no longer there. The original state has been restored.

closes odoo/odoo#129509

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-26 09:21:56 +02:00
Aaron Bohy bc95c6a348 [REF] web,*: remove legacy client action support
This commit removes a lot of legacy code that we kept for the few
legacy client actions that were still to be converted to owl. Now
that the last one has been converted, we can finally get rid of a
lot of legacy code (ActionAdapter, ActionMixin, ControlPanel,
ActionMenus, DropdownMenu(Item), Pager, DomainSelector...).

Part of task~3439226

closes odoo/odoo#129314

Related: odoo/enterprise#44465
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-25 17:35:47 +02:00
Aaron Bohy f16e23c23f [IMP] web: orm service: add "webRead" function
This commit adds a shortcut in the orm service to call the new
"web_read" python method and adapts the few calls to use it.

closes odoo/odoo#129502

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-07-25 13:26:37 +02:00
Jorge Pinna Puissant 3967dab0ce [REF] web: RelationalModel: do not change resId in Record
With this commit, we ensure that the resId of a Record datapoint
never changes. The only exception is for new records: their resId
can go from `false` to their actual id when they are created. When
we want to load another record, we must use the `load` function of
the model, which now accepts `resId` (and `resIds`) as param, when
the root is a "mono record".

As a consequence, the instance of record datapoint now changes when
using the pager. This required some changes in the AceField, to
make it properly react in that case. We took the opportunity to
simplify its implementation (several keys in the state were useless).

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:57 +02:00
Aaron Bohy 65c8f41cf3 [FIX] web: Record: complete relational values
Now that the RelationalModel is based on unity, datapoints expect
to receive their data as returned by unity read (i.e. x2many values
are list of records, not ids, and many2one values are objects with
keys id and display_name, not tuple, or simple ids). As a
consequence, the Record component needed to be slightly adapted for
current usecases to continue working (e.g. using a Record component
for a Many2ManyTags field, and providing the value of the many2many
as a list of ids, like in the studio action editor sidebar).

This commit completes the relational values received by the Record
component with the related records, like if they were read by
unity.

The Record component's API will be reworked soon, now that the
new RelationalModel has been merged, to be more compliant with the
new unity concept.

Part of~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:57 +02:00
Aaron Bohy 0994e0ff6d [FIX] web: Many2ManyCheckboxes: batch changes
Have a many2many field with widget many2many_checkboxes. Before
this commit, the widget notified the model (i.e. called replaceWith
on the static list) for each change of one of its checkboxes. This
means that if the was an onchange on the field, the onchange rpc
was done once for each click. With this commit, we debounce the
call to replaceWith, which allows to tick/untick multiple
checkboxes, and a single onchange is done with the resulting value.

This allows to mitigate another issue, which is that consecutive
calls to replaceWith are error prone, because they might send a
list of ids which isn't up to date with the one of the last call
to replaceWith (if the list is computed from the value in the
datapoint), as replaceWith uses the model mutex and thus updates
the datapoint in an async way. This specific issue will be tackled
later.

Part of~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Jorge Pinna Puissant a41e5ff690 [FIX] web: allow x2many fields without relation_field
Have a field x2many without relation_field.

Before this commit, a server error was raised because, we send changes
for the non-existing field (relation_field).

Now, we only send to the server the changes for relation_field only if
they exist.

Note that, this commit will also add an exception on the server mock
onchange if we sent changes for non-existings fields.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Jorge Pinna Puissant 2129d774a2 [FIX] web: do not read if field spec is empty
Have a view with many2many_checkboxes field (e.g. product.template
form view with inventory installed, and some routes). Tick a
checkbox. Before this commit, a read was done, but the field spec
was empty (there was no field to read). So basically the read only
returned the id. This is obviously useless. This commit prevents
from doing read rpcs when the spec is empty.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:56 +02:00
Aaron Bohy 0df1f4d439 [FIX] web: forget command for nested x2many in form, not in list
Have a form view with an x2many field A displayed as a non editable
list view. In A's form view, there's an x2many field B, which isn't
in the list. B is itself displayed in the dialog form view as a
list, which contains an x2many fields C displayed as many2many_tags.

A contains a record. For this record, B contains also a record,
which contains two tags for C.

Have an onchange on the main record which triggers an update command
for the record in A, such that the command also updates the record
in B, which deletes (or forgets), i.e. commands 2 or 3, a tag C.

Before this commit, if the user opened the x2many record of A after
the onchange, it didn't displayed the remaining tag in C. The
reason is that we received commands to remove the tag before we
actually fetched them (as we don't need them for the list of A).
The tags were then fetched when we opened the record in a dialog,
but we didn't correctly merge the values read from the server with
the commands we received earlier.

With this commit, we properly store the commands and apply them
after reading the values.

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
Aaron Bohy 0e2d8eeabe [FIX] web: o2m multi page command forget second page
Have an x2many list or kanban with several page, and an onchange
on the main record that returns forget or delete commands for
x2many records that aren't on the first page. Before this commit,
it crashed, because the code expected the records to be in
this.records (the record of the current page).

Part of task~3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
Pierre Rousseau 30d2e224d8 [IMP] web: image field: add option to bypass image reloading
With the image field widget, the image is reloaded each time the record
is updated (when `write_date` is updated). This is not always desirable
as some images are not supposed to change.

This commit adds an option to bypass the image reloading. This option
is called `no_reload` and is set to `false` by default.

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00
Jorge Pinna Puissant 88b4938b7c [FIX] web: one2many, await onchange when resequence
- On an one2many;
- drag and drop two records;
- a resequence is called, with an onchange;
- click save;

Before this commit, if the network was a little too slow, the return of
the onchange wasn't taken it into account for the save.

Now, we await the onchange of the resequence before executing another
action.

Task 3179751

Part-of: odoo/odoo#114024
2023-07-24 20:17:55 +02:00