summaryrefslogtreecommitdiff
path: root/addons/barcodes/static/src/js/form_view_barcode_handler.js
diff options
context:
space:
mode:
authorJairo Llopis <Yajo@users.noreply.github.com>2016-10-14 14:54:02 +0200
committerRaphael Collet <rco@openerp.com>2016-10-14 14:54:02 +0200
commit448521df6464bbe1ec1ebabcedb48c05eb0adda1 (patch)
treebcffcf769c1b0e50dda30e27f9627ea7bc5f9dc9 /addons/barcodes/static/src/js/form_view_barcode_handler.js
parent852e2c557e3449db2f367fca69d9c6a778996ae4 (diff)
[FIX] fields: setting a one2many field deletes all its lines (#13082)
Setting the value of a one2many field (`rec.line_ids = ...`) converts the new recordset to a list of commands, and passes it to `write`. Currently the list of commands is like: `[(5,), (0, 0, vals), (1, id, vals), (4, id), ...]`. Notice that the command `(5,)` is inappropriate here: it deletes all the existing lines of the record. Reintroducing the same lines with `(4, id)` commands crashes, because the corresponding `id` is no longer in database. The fix serializes the recordset as a list of commands like `[(6, 0, ids), (0, 0, vals), (1, id, vals), ...]`. Only the lines that are not kept will be deleted in this case.
Diffstat (limited to 'addons/barcodes/static/src/js/form_view_barcode_handler.js')
0 files changed, 0 insertions, 0 deletions