summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNhomar Hernández <nhomar@vauxoo.com>2018-08-13 15:26:33 -0500
committerMartin Trigaux <mat@odoo.com>2018-08-14 13:59:59 +0200
commitc77d4effc428c03f07888578d760ede6f04d9a70 (patch)
tree4d52ce8714a82af22d04f58f0bcf65b46c0193ab
parent4dfabb8f7adde06a7936502af61534c9958ed4f7 (diff)
[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
-rw-r--r--addons/web/static/src/js/widgets/debug_manager.js31
-rw-r--r--addons/web/static/src/xml/base.xml11
-rw-r--r--odoo/addons/base/views/ir_model_views.xml5
3 files changed, 21 insertions, 26 deletions
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({
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index c5581976e30..fa2e7ae785f 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -259,17 +259,6 @@
</t>
</t>
</t>
-<t t-name="WebClient.DebugManager.Action.Fields">
- <dl><t t-foreach="fields" t-as="field">
- <dt><h4><t t-esc="field"/></h4></dt>
- <dd>
- <dl><ul role="menu"><li role="menuitem" t-foreach="field_value" t-as="attribute">
- <strong><t t-esc="attribute"/></strong>:
- <t t-esc="attribute_value"/>
- </li></ul></dl>
- </dd>
- </t></dl>
-</t>
<t t-name="WebClient.DebugManager.View">
<t t-if="view">
<div role="separator" class="dropdown-divider"/>
diff --git a/odoo/addons/base/views/ir_model_views.xml b/odoo/addons/base/views/ir_model_views.xml
index f8ab6ed25fa..c83830301b3 100644
--- a/odoo/addons/base/views/ir_model_views.xml
+++ b/odoo/addons/base/views/ir_model_views.xml
@@ -349,6 +349,10 @@
<field name="model_id"/>
<field name="ttype"/>
<field name="state"/>
+ <field name="index"/>
+ <field name="store"/>
+ <field name="readonly"/>
+ <field name="relation"/>
</tree>
</field>
</record>
@@ -371,6 +375,7 @@
<field name="readonly"/>
<group expand="0" string="Group By">
<filter string="Object" name="group_by_object" domain="[]" context="{'group_by':'model_id'}"/>
+ <filter string="Type" name="group_by_ttype" domain="[]" context="{'group_by':'ttype'}"/>
</group>
</search>
</field>