From 19cbbb21fb42e208bef55b4bcc62ed08cea4c742 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Thu, 1 Jun 2017 11:51:21 +0200 Subject: =?UTF-8?q?[FIX]=20web:=20handle=20=C2=B4domain=C2=B4=20widget=20r?= =?UTF-8?q?endering=20without=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- addons/web/static/src/js/views/basic/basic_model.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web/static/src/js/views/basic') 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(); -- cgit v1.2.3