From c77d4effc428c03f07888578d760ede6f04d9a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nhomar=20Hern=C3=A1ndez?= Date: Mon, 13 Aug 2018 15:26:33 -0500 Subject: [IMP] web: Better view fields for debug mode. When you need to fast review all properties of a model, mostly the fields it is really anoying go to all the technical path which has all the information already. The previous "View Fields" action was very messy. My proposal is simply instead use a dialog which is almost useless open a normal vie (a little improved) which allow us audit completely everything. Remove the previous dialog, this will not be used anymore. Closes #26364 --- addons/web/static/src/js/widgets/debug_manager.js | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'addons/web/static/src/js/widgets/debug_manager.js') diff --git a/addons/web/static/src/js/widgets/debug_manager.js b/addons/web/static/src/js/widgets/debug_manager.js index d553387f153..b96c38ab998 100644 --- a/addons/web/static/src/js/widgets/debug_manager.js +++ b/addons/web/static/src/js/widgets/debug_manager.js @@ -271,23 +271,24 @@ DebugManager.include({ }); }, get_view_fields: function () { - var self = this; - var model = this._action.res_model; + var model = this._action.res_model, + self = this; this._rpc({ - model: model, - method: 'fields_get', - kwargs: { - attributes: ['string', 'searchable', 'required', 'readonly', 'type', 'store', 'sortable', 'relation', 'help'] - }, - }) - .done(function (fields) { - new Dialog(self, { - title: _.str.sprintf(_t("Fields of %s"), model), - $content: $(QWeb.render('WebClient.DebugManager.Action.Fields', { - fields: fields - })) - }).open(); + model: 'ir.model', + method: 'search', + args: [[['model', '=', model]]] + }).done(function (ids) { + self.do_action({ + res_model: 'ir.model.fields', + name: _t('View Fields'), + views: [[false, 'list'], [false, 'form']], + domain: [['model_id', '=', model]], + type: 'ir.actions.act_window', + context: { + 'default_model_id': ids[0] + } }); + }); }, manage_filters: function () { this.do_action({ -- cgit v1.2.3