[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
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user