2011-08-23 10:39:41 +00:00
|
|
|
openerp.base.view_editor = function(openerp) {
|
2011-09-05 12:32:36 +00:00
|
|
|
openerp.base.ViewEditor = openerp.base.Widget.extend({
|
2011-08-23 10:39:41 +00:00
|
|
|
init: function(parent, element_id, dataset, view, options) {
|
|
|
|
this._super(parent);
|
|
|
|
this.element_id = element_id
|
|
|
|
this.parent = parent
|
|
|
|
this.dataset = dataset;
|
|
|
|
this.model = dataset.model;
|
|
|
|
this.fields_views = view;
|
|
|
|
},
|
|
|
|
start: function() {
|
|
|
|
|
|
|
|
var self = this;
|
2011-08-23 10:40:54 +00:00
|
|
|
var action = {
|
|
|
|
name:'ViewEditor',
|
|
|
|
context:this.session.user_context,
|
2011-08-31 11:00:36 +00:00
|
|
|
domain: [["model", "=", this.dataset.model]],
|
2011-08-23 10:40:54 +00:00
|
|
|
res_model: 'ir.ui.view',
|
|
|
|
views : [[false, 'list']],
|
|
|
|
type: 'ir.actions.act_window',
|
|
|
|
target: "current",
|
|
|
|
limit : 80,
|
|
|
|
auto_search : true,
|
|
|
|
flags: {
|
|
|
|
sidebar: false,
|
|
|
|
views_switcher: false,
|
|
|
|
action_buttons:false,
|
|
|
|
search_view:false,
|
|
|
|
pager:false,
|
2011-09-05 12:32:36 +00:00
|
|
|
radio:true
|
2011-08-23 10:40:54 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
var action_manager = new openerp.base.ActionManager(this);
|
|
|
|
this.dialog = new openerp.base.Dialog(this,{
|
|
|
|
modal: true,
|
|
|
|
title: 'ViewEditor',
|
2011-09-05 12:32:36 +00:00
|
|
|
width: 750,
|
2011-08-23 10:40:54 +00:00
|
|
|
height: 500,
|
|
|
|
buttons: {
|
2011-09-05 12:32:36 +00:00
|
|
|
"Create": function(){
|
2011-08-23 10:40:54 +00:00
|
|
|
$(this).dialog('destroy');
|
|
|
|
},
|
2011-09-05 12:32:36 +00:00
|
|
|
"Edit": function(){
|
|
|
|
self.Edit_view();
|
2011-08-23 10:40:54 +00:00
|
|
|
},
|
2011-09-05 12:32:36 +00:00
|
|
|
" Close": function(){
|
2011-08-23 10:40:54 +00:00
|
|
|
}
|
|
|
|
},
|
2011-09-05 12:32:36 +00:00
|
|
|
|
2011-08-23 10:40:54 +00:00
|
|
|
});
|
2011-09-05 12:32:36 +00:00
|
|
|
this.dialog.start();
|
2011-08-23 10:40:54 +00:00
|
|
|
this.dialog.open();
|
|
|
|
action_manager.appendTo(this.dialog);
|
|
|
|
action_manager.do_action(action);
|
2011-08-23 10:39:41 +00:00
|
|
|
},
|
2011-09-05 12:32:36 +00:00
|
|
|
|
|
|
|
Edit_view : function(){
|
|
|
|
|
|
|
|
this.dialog = new openerp.base.Dialog(this,{
|
|
|
|
modal: true,
|
|
|
|
title: 'Edit Xml',
|
|
|
|
width: 750,
|
|
|
|
height: 500,
|
|
|
|
buttons: {
|
|
|
|
"Inherited View": function(){
|
|
|
|
|
|
|
|
},
|
|
|
|
"Preview": function(){
|
|
|
|
|
|
|
|
},
|
|
|
|
"Close": function(){
|
|
|
|
$(this).dialog('destroy');
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
this.dialog.start().open();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-08-23 10:39:41 +00:00
|
|
|
});
|
|
|
|
};
|