Files
odoo_source/addons/web
Aaron Bohy f40ab7c811 [FIX] web: BasicModel: clear x2many changes after save
Before this commit, after a save, we didn't remove the changes in
x2many fields (StaticList). As a consequence, if save was called
twice on a record with changes in a x2many, those changes were
sent twice to the server. In particular, if those changes involved
a command 0 (create), the record was created twice.

To reproduce the issue, go to a sale order, add a line, select a
product, click out to validate the row, then click several times
on the product. As you clicked several times, several doAction are
asked to the action service. For each of them, the form view is
asked to save its changes, and thus the same row is created multiple
times.

After this fix, the changes in x2manys are cleared after the first
save, so there's no change the save for the subsequent calls.

opw-3268947
opw-3324848

closes odoo/odoo#123851

X-original-commit: 9073304660ee64c7051b7ed86f8fa3513fe6ba7a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-06 11:45:22 +02:00
..
…
2023-06-02 10:45:11 +02:00