-
- Downloads
[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`.
Loading
Please register or sign in to comment