[ADD] Added View Log (perm_read) option in debug select box

lp bug: https://launchpad.net/bugs/914277 fixed

bzr revid: fme@openerp.com-20120124170111-i35l4qclarypsrh1
This commit is contained in:
Fabien Meghazi 2012-01-24 18:01:11 +01:00
parent 518784caca
commit b39e6ae7f1
3 changed files with 56 additions and 2 deletions

View File

@ -2286,6 +2286,24 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
color: black;
}
/* Debug stuff */
.openerp .oe_debug_view_log {
font-size: 95%;
}
.openerp .oe_debug_view_log label {
display: block;
width: 49%;
text-align: right;
float: left;
font-weight: bold;
color: #009;
}
.openerp .oe_debug_view_log span {
display: block;
width: 49%;
float: right;
color: #333;
}
/* Internet Explorer Fix */
a img {

View File

@ -557,6 +557,20 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
var dialog = new session.web.Dialog(this, { title: _t("Fields View Get"), width: '95%' }).open();
$('<pre>').text(session.web.json_node_to_xml(current_view.fields_view.arch, true)).appendTo(dialog.$element);
break;
case 'perm_read':
var ids = current_view.get_selected_ids();
if (ids.length === 1) {
this.dataset.call('perm_read', [ids]).then(function(result) {
var dialog = new session.web.Dialog(this, {
title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model),
width: 400
}, QWeb.render('ViewManagerDebugViewLog', {
perm : result[0],
format : session.web.format_value
})).open();
});
}
break;
case 'fields':
this.dataset.call_and_eval(
'fields_get', [false, {}], null, 1).then(function (fields) {

View File

@ -471,17 +471,39 @@
</t>
<t t-name="ViewManagerDebug">
<option value="">Debug View#<t t-esc="view.fields_view.view_id"/></option>
<option value="fvg">Fields View Get</option>
<option t-if="_.indexOf(['form', 'page'], view_manager.active_view) gt -1" value="perm_read" data-views="form,page">View Log (perm_read)</option>
<option value="fields">View Fields</option>
<option value="fvg">Fields View Get</option>
<t t-if="view_manager.session.uid === 1">
<option value="manage_views">Manage Views</option>
<option value="edit" data-model="ir.ui.view" t-att-data-id="view.fields_view.view_id">Edit <t t-esc="_.str.capitalize(view.fields_view.type)"/>View</option>
<option t-if="view_manager.searchview" value="edit" data-model="ir.ui.view" t-att-data-id="view_manager.searchview.view_id">Edit SearchView</option>
<option t-if="view_manager.action" value="edit" t-att-data-model="view_manager.action.type" t-att-data-id="view_manager.action.id">Edit Action</option>
<option value="customize_object">Customize Object</option>
<option value="edit_workflow">Edit Workflow</option>
<option value="customize_object">Customize Object</option>
</t>
</t>
<t t-name="ViewManagerDebugViewLog">
<div class="oe_debug_view_log">
<label>ID:</label>
<span><t t-esc="perm.id"/></span>
<label>XML ID:</label>
<span><t t-esc="perm.xmlid"/></span>
<label>Creation User:</label>
<span><t t-esc="format(perm.create_uid, { 'type' : 'many2one' }, '/')"/></span>
<label>Creation Date:</label>
<span><t t-esc="format(perm.create_date, { 'type' : 'datetime' }, '/')"/></span>
<label>Latest Modification by:</label>
<span><t t-esc="format(perm.write_uid, { 'type' : 'many2one' }, '/')"/></span>
<label>Latest Modification Date:</label>
<span><t t-esc="format(perm.write_date, { 'type' : 'datetime' }, '/')"/></span>
</div>
</t>
<t t-extend="ViewManager" t-name="One2Many.viewmanager">
<t t-jquery="span.oe_view_title_text" t-operation="replace"/>