Files
odoo_source/addons
Hubert Van De Walle bc326fa21e [FIX] web: prevent multiple updates when pressing enter
Steps to reproduce
==================

In 16.4:
- Go to Accounting > Reconcile 8 items
- Click on the first line on the right
- Edit the label and then press Enter
- Switch to another line

=> Odoo Server Error

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

When pressing Enter, two events are triggered: keydown and change.
In the useInputField hook, there is a listener for both of those events,
and they both end up calling `record.update` with the current value from
the input.

In the relational model, the update is locked inside a mutex.

So the first update (triggered by the keydown) does an onchange.
This onchange deletes the current records (Command.CLEAR) and returns
new records.

Once this is done, the mutex is released. The second update (triggered
by the change event) then tries the same update. Since the value was
obtained when queuing for the mutex, it uses the old (now deleted)
record.

Solution
========

This adds a test for https://github.com/odoo/odoo/pull/154991
as part of the fix got lost in a conflict resolution for previous versions.

opw-3726818

closes odoo/odoo#157155

X-original-commit: fbebffe446de9dd80db2dbe5ca7bd2746dc2a54f
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-11 11:55:08 +00:00
..
2024-03-08 11:17:48 +00:00
2024-03-08 11:17:47 +00:00
2024-02-22 09:06:12 +00:00
2024-01-15 09:30:53 +00:00
2024-01-26 09:13:03 +00:00
2024-03-11 10:17:49 +00:00