Skip to content
Snippets Groups Projects
Commit 9f81c6d6 authored by Raphael Collet's avatar Raphael Collet
Browse files

[IMP] models, fields: change output format of method `onchange` for x2many fields

Use `field.convert_to_onchange` to format the output of method `onchange`.  By
default it behaves like `convert_to_read`.  This is useful for the many2one
case, as the client automatically receives the display name of the record.

For the *2many case, we return a list of dicts values, in recordset order, with
all the known fields in the view:

    [{id: 42, name: "Existing record"}, {name: "New record"}, ...]

Each dictionary contains the values of all known fields in the view.  The
client is responsible of determining which fields are dirty by computing the
difference with former values.

Since the method `onchange` now uses `field.convert_to_onchange`, the method
`field.convert_to_write` has been simplified, as it no longer needs its extra
parameters `target` and `fnames`.
parent 36ffa5bc
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment