diff options
| author | Krzysztof Magusiak <chris.magusiak@gmail.com> | 2021-03-22 10:25:58 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2021-03-24 12:16:41 +0000 |
| commit | 3826a2645b94e0f62c719814c4dbe4cc6502e1f2 (patch) | |
| tree | 1e107709d9ce0c3f5d0d9786c081af787ee96c28 /addons/web/static/src | |
| parent | 3fb99e44164b4bfe79ba7ba61efff39c45006cac (diff) | |
[FIX] web: can update one2many with custom field widget
One might design a custom field widget to display/interact with a
one2many field. Before this commit, if this field widget triggered
a field_changed event to update a related record, it crashed,
because the code assumed that there was a view associated with the
field.
Closes #68276
opw~2468238
closes odoo/odoo#68294
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 78606e717d7..c51f512b966 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2024,7 +2024,9 @@ var BasicModel = AbstractModel.extend({ case 'UPDATE': list._changes.push({operation: 'UPDATE', id: command.id}); if (command.data) { - defs.push(this._applyChange(command.id, command.data, { viewType: view.type })); + defs.push(this._applyChange(command.id, command.data, { + viewType: view && view.type, + })); } break; case 'FORGET': |
