diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-08-29 13:41:28 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-08-29 13:59:49 +0200 |
| commit | 4f61e7f0481fa2e2bfd806d92ea77f07b78d42de (patch) | |
| tree | 7f48d41776b67e5940766b9af989acbd3d6141ed /addons/web/static/src/js | |
| parent | c5bf53682e159343ee0c707f6d7f2da972d6add2 (diff) | |
[FIX] web: WidgetDomain: don't crash on false domain
Before this rev., when the value of a field with widget='domain'
was false, the search_count RPC made to display the number of
records matching the domain crashed, and the widget displayed that
the domain was invalid. This rev. adds a fallback on [] when the
domain is false.
Diffstat (limited to 'addons/web/static/src/js')
| -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 aa0aab7aa64..9dc544ba84f 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2043,7 +2043,7 @@ var BasicModel = AbstractModel.extend({ if (record.data.hasOwnProperty(domainModel)) { domainModel = record._changes && record._changes[domainModel] || record.data[domainModel]; } - var domainValue = record._changes && record._changes[fieldName] || record.data[fieldName]; + var domainValue = record._changes && record._changes[fieldName] || record.data[fieldName] || []; // avoid rpc if not necessary var hasChanged = this._saveSpecialDataCache(record, fieldName, { |
