summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorCedric Snauwaert <csn@openerp.com>2017-07-03 14:58:22 +0200
committerGéry Debongnie <ged@odoo.com>2017-07-05 14:47:13 +0200
commit1e30b30a8fc08d539cb68fa214226501a3fb96d6 (patch)
tree7d3b45838166ab9b4eb893a7ac6b73001a872317 /addons/web/static/src
parenta43b0464b28ce53074b027469747e379bbb389c4 (diff)
[FIX] web: onchange with domain should not crash if field is not in view
In some cases (onchange in a purchase order), the onchange can return a domain for a field that is not in view. It should not be the case, but it is really simple to protect the web client anyway.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js4
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 61c153e9032..2f06168fd23 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -2996,7 +2996,9 @@ var BasicModel = AbstractModel.extend({
if (result.domain) {
var fieldsInfo = record.fieldsInfo[viewType || record.viewType];
for (var fieldName in result.domain) {
- fieldsInfo[fieldName].domain = result.domain[fieldName];
+ if (fieldsInfo[fieldName]) {
+ fieldsInfo[fieldName].domain = result.domain[fieldName];
+ }
}
}
return self._applyOnChange(result.value, record).then(function () {