summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-06-01 11:51:21 +0200
committerMartin Geubelle <mge@odoo.com>2017-06-01 13:23:30 +0200
commit19cbbb21fb42e208bef55b4bcc62ed08cea4c742 (patch)
treea96585ab35f7de2ef9a3fb92665bad91ed1ab787 /addons/web/static/src/js
parent2f4d3d0e667092f70f44db03437473acf4ad5b32 (diff)
[FIX] web: handle ´domain´ widget rendering without model
When creating a new record where the ´domain´ widget is set in the view with an associated model but this model field has no value, an rpc (search_count) was done on an unknown model, that causes a traceback. To avoid this, the rpc is not done if the model is not set.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js5
1 files changed, 5 insertions, 0 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 eef858ddcfa..16970b2c21b 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1645,6 +1645,11 @@ var BasicModel = AbstractModel.extend({
});
if (!hasChanged) {
return $.when();
+ } else if (!domainModel) {
+ return $.when({
+ model: domainModel,
+ nbRecords: 0,
+ });
}
var def = $.Deferred();