odoo / odoo

Odoo. Open Source Apps To Grow Your Business.
https://www.odoo.com
Other
37.54k stars 24.42k forks source link

[17][BUG] Onchange of computed o2m field leaves initially loaded records #164520

Open dz0 opened 4 months ago

dz0 commented 4 months ago

Impacted versions: 17.0

Steps to reproduce:

Current behavior:

Expected behavior:

dz0 commented 4 months ago

Noticed when migrating from v13.0,

digging bit, I found the new onchange trying to be smart -- https://github.com/odoo/odoo/pull/119510/files/#diff-1a4d514ed8aaa48bfdaf205130a09ccc3645c905369f35c1bd83b8dc2c2e3bc7R1145

Instead of returning full list, it returns Command.DELTETE for previous items, that should not be shown... and Command.CREATE or Command.LINK for the new ones..
I didn't find the JS code for handling onchange, but using dev-tools request inspection, noticed, that JS tracks the changed fields in the form, and sends them back to server, so it knows to refresh them or so.

But JS part misses the case for initially loaded items that need to be "refreshed"/removed.

dz0 commented 4 months ago

As very dumb workaround I can overwrite onchange - see commented out part