Skip to content
Snippets Groups Projects
Commit e6163972 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] web: resequence work w/ discardable lines


In 11.0 091c86c2 introduced the unselection of lines when line are
resequenced to solve some issue.

There seems to be a related issue in the following use case if:

- the one2many has a handle field
- the lines have same sequence (eg. adding 2 o2m lines on new record)
- there is an invalid o2m line (eg. empty line and required field)
- without blurring, a valid line is moved

then this happen:

- the sequence of lines are computed
- the invalid line is removed
- the computed sequence of lines are applied

=> this break next onchange, because we try to apply an onchange to data
that does not exist anymore (the invalid line).

With this changeset, the invalid lines are discarded before sequences
are computed so the computation is still correct before being applied.

Without the change, the added test fails with:

5. one onchange happens when lines are resequenced (expect: 3, res: 2)
7. one onchange happens when a line is added (expect: 4, res: 2)
8. onchange worked there is 2 lines (expect: 2, res: 1)

opw-1966589
closes #33591

Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
parent a20a3148
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment