diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-06-26 15:40:09 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-06-27 14:12:31 +0200 |
| commit | 9fbed63406702b43e41262da24d68f63feb582f0 (patch) | |
| tree | 5afe24d5e40e18a32fd85a175e6e942050cd8b42 /addons/web/static/src | |
| parent | 7ea6f653df0863e9c0dbaf0b07800c0277b962b1 (diff) | |
[FIX] web: FieldSelection on m2o: unset value
When the value of a many2one field with widget selection was unset,
it's value wasn't actually set to false in the BasicModel. It was
set to a virtual id like 'virtual_294' instead. This caused a
traceback when this value was sent to the server, obviously.
This was for example the case of the Register Payment form view
(accessible from a customer invoice), when the user selected a
payment journal, and then unselected it (the virtual id was then
sent to the onchange RPC).
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 2 |
1 files changed, 1 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 1001ac73857..811e3632975 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1001,7 +1001,7 @@ var BasicModel = AbstractModel.extend({ */ _applyMany2OneChange: function (record, fieldName, data) { var self = this; - if (!data) { + if (!data || data.id === false) { record._changes[fieldName] = false; return $.when(); } |
