[imp] renamed widget_parent to getParent()
bzr revid: nicolas.vanhoren@openerp.com-20120221153023-cqs66neaddtuf7km
This commit is contained in:
parent
a6f6b7fd9d
commit
8384876ef0
|
@ -261,7 +261,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin
|
|||
$(".loading",this.$element).text(_.str.sprintf(
|
||||
_t("Loading (%d)"), this.count));
|
||||
$(".loading",this.$element).show();
|
||||
this.widget_parent.$element.addClass('loading');
|
||||
this.getParent().$element.addClass('loading');
|
||||
} else {
|
||||
this.count = 0;
|
||||
clearTimeout(this.long_running_timer);
|
||||
|
@ -271,7 +271,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin
|
|||
$.unblockUI();
|
||||
}
|
||||
$(".loading",this.$element).fadeOut();
|
||||
this.widget_parent.$element.removeClass('loading');
|
||||
this.getParent().$element.removeClass('loading');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -381,7 +381,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
|
|||
|
||||
var admin = result[1][0];
|
||||
setTimeout(function () {
|
||||
self.widget_parent.do_login(
|
||||
self.getParent().do_login(
|
||||
info.db, admin.login, admin.password);
|
||||
self.stop();
|
||||
self.unblockUI();
|
||||
|
@ -437,7 +437,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
|
|||
if (self.db_list) {
|
||||
self.db_list.push(self.to_object(fields)['db_name']);
|
||||
self.db_list.sort();
|
||||
self.widget_parent.set_db_list(self.db_list);
|
||||
self.getParent().set_db_list(self.db_list);
|
||||
}
|
||||
var form_obj = self.to_object(fields);
|
||||
self.wait_for_newdb(result, {
|
||||
|
@ -469,7 +469,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
|
|||
$db_list.find(':selected').remove();
|
||||
if (self.db_list) {
|
||||
self.db_list.splice(_.indexOf(self.db_list, db, true), 1);
|
||||
self.widget_parent.set_db_list(self.db_list);
|
||||
self.getParent().set_db_list(self.db_list);
|
||||
}
|
||||
self.do_notify("Dropping database", "The database '" + db + "' has been dropped");
|
||||
});
|
||||
|
|
|
@ -1017,6 +1017,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
|
|||
// useful to know if the widget was destroyed and should not be used anymore
|
||||
this.widget_is_stopped = false;
|
||||
},
|
||||
getParent: function() {
|
||||
return this.widget_parent;
|
||||
},
|
||||
/**
|
||||
* Renders the current widget and appends it to the given jQuery object or Widget.
|
||||
*
|
||||
|
|
|
@ -201,8 +201,8 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
|
|||
return;
|
||||
}
|
||||
if (results['success']) {
|
||||
if (this.widget_parent.widget_parent.active_view == "list") {
|
||||
this.widget_parent.reload_content();
|
||||
if (this.getParent().getParent().active_view == "list") {
|
||||
this.getParent().reload_content();
|
||||
}
|
||||
this.stop();
|
||||
return;
|
||||
|
|
|
@ -303,10 +303,10 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea
|
|||
});
|
||||
self.rpc('/web/searchview/add_to_dashboard', {
|
||||
menu_id: menu_id,
|
||||
action_id: self.widget_parent.action.id,
|
||||
action_id: self.getParent().action.id,
|
||||
context_to_save: context,
|
||||
domain: domain,
|
||||
view_mode: self.widget_parent.active_view,
|
||||
view_mode: self.getParent().active_view,
|
||||
name: title
|
||||
}, function(r) {
|
||||
if (r === false) {
|
||||
|
@ -1173,9 +1173,9 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({
|
|||
props);
|
||||
},
|
||||
stop: function() {
|
||||
var parent = this.widget_parent;
|
||||
if (this.widget_parent.widget_children.length == 1)
|
||||
this.widget_parent.hide();
|
||||
var parent = this.getParent();
|
||||
if (this.getParent().widget_children.length == 1)
|
||||
this.getParent().hide();
|
||||
this._super();
|
||||
parent.check_last_element();
|
||||
},
|
||||
|
@ -1215,8 +1215,8 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/**
|
|||
},
|
||||
stop: function() {
|
||||
var parent;
|
||||
if (this.widget_parent.widget_children.length == 1)
|
||||
parent = this.widget_parent;
|
||||
if (this.getParent().widget_children.length == 1)
|
||||
parent = this.getParent();
|
||||
this._super();
|
||||
if (parent)
|
||||
parent.stop();
|
||||
|
|
|
@ -2782,7 +2782,7 @@ openerp.web.form.Many2ManyListView = openerp.web.ListView.extend(/** @lends open
|
|||
var pop = new openerp.web.form.FormOpenPopup(this);
|
||||
pop.show_element(this.dataset.model, id, this.m2m_field.build_context(), {
|
||||
title: _t("Open: ") + this.name,
|
||||
readonly: this.widget_parent.is_readonly()
|
||||
readonly: this.getParent().is_readonly()
|
||||
});
|
||||
pop.on_write_completed.add_last(function() {
|
||||
self.reload_content();
|
||||
|
|
|
@ -96,7 +96,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
|||
if (this._limit === undefined) {
|
||||
this._limit = (this.options.limit
|
||||
|| this.defaults.limit
|
||||
|| (this.widget_parent.action || {}).limit
|
||||
|| (this.getParent().action || {}).limit
|
||||
|| 80);
|
||||
}
|
||||
return this._limit;
|
||||
|
|
|
@ -47,14 +47,14 @@ session.web.ActionManager = session.web.OldWidget.extend({
|
|||
}
|
||||
},
|
||||
do_push_state: function(state) {
|
||||
if (this.widget_parent && this.widget_parent.do_push_state) {
|
||||
if (this.getParent() && this.getParent().do_push_state) {
|
||||
if (this.inner_action) {
|
||||
state['model'] = this.inner_action.res_model;
|
||||
if (this.inner_action.id) {
|
||||
state['action_id'] = this.inner_action.id;
|
||||
}
|
||||
}
|
||||
this.widget_parent.do_push_state(state);
|
||||
this.getParent().do_push_state(state);
|
||||
}
|
||||
},
|
||||
do_load_state: function(state, warm) {
|
||||
|
@ -150,7 +150,7 @@ session.web.ActionManager = session.web.OldWidget.extend({
|
|||
this.dialog.open();
|
||||
} else {
|
||||
if(action.menu_id) {
|
||||
return this.widget_parent.do_action(action, function () {
|
||||
return this.getParent().do_action(action, function () {
|
||||
session.webclient.menu.open_menu(action.menu_id);
|
||||
});
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ session.web.ActionManager = session.web.OldWidget.extend({
|
|||
window.open(action.url, action.target === 'self' ? '_self' : '_blank');
|
||||
},
|
||||
ir_ui_menu: function (action) {
|
||||
this.widget_parent.do_action(action);
|
||||
this.getParent().do_action(action);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -680,9 +680,9 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
|
|||
});
|
||||
},
|
||||
do_push_state: function(state) {
|
||||
if (this.widget_parent && this.widget_parent.do_push_state) {
|
||||
if (this.getParent() && this.getParent().do_push_state) {
|
||||
state["view_type"] = this.active_view;
|
||||
this.widget_parent.do_push_state(state);
|
||||
this.getParent().do_push_state(state);
|
||||
}
|
||||
},
|
||||
do_load_state: function(state, warm) {
|
||||
|
@ -702,7 +702,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
|
|||
},
|
||||
shortcut_check : function(view) {
|
||||
var self = this;
|
||||
var grandparent = this.widget_parent && this.widget_parent.widget_parent;
|
||||
var grandparent = this.getParent() && this.getParent().getParent();
|
||||
// display shortcuts if on the first view for the action
|
||||
var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle');
|
||||
if (!this.action.name ||
|
||||
|
@ -796,8 +796,8 @@ session.web.Sidebar = session.web.OldWidget.extend({
|
|||
},
|
||||
add_default_sections: function() {
|
||||
var self = this,
|
||||
view = this.widget_parent,
|
||||
view_manager = view.widget_parent,
|
||||
view = this.getParent(),
|
||||
view_manager = view.getParent(),
|
||||
action = view_manager.action;
|
||||
if (this.session.uid === 1) {
|
||||
this.add_section(_t('Customize'), 'customize');
|
||||
|
@ -912,8 +912,8 @@ session.web.Sidebar = session.web.OldWidget.extend({
|
|||
},
|
||||
on_item_action_clicked: function(item) {
|
||||
var self = this;
|
||||
self.widget_parent.sidebar_context().then(function (context) {
|
||||
var ids = self.widget_parent.get_selected_ids();
|
||||
self.getParent().sidebar_context().then(function (context) {
|
||||
var ids = self.getParent().get_selected_ids();
|
||||
if (ids.length == 0) {
|
||||
//TODO: make prettier warning?
|
||||
openerp.web.dialog($("<div />").text(_t("You must choose at least one record.")), {
|
||||
|
@ -925,7 +925,7 @@ session.web.Sidebar = session.web.OldWidget.extend({
|
|||
var additional_context = _.extend({
|
||||
active_id: ids[0],
|
||||
active_ids: ids,
|
||||
active_model: self.widget_parent.dataset.model
|
||||
active_model: self.getParent().dataset.model
|
||||
}, context);
|
||||
self.rpc("/web/action/load", {
|
||||
action_id: item.action.id,
|
||||
|
@ -937,7 +937,7 @@ session.web.Sidebar = session.web.OldWidget.extend({
|
|||
result.result.flags.new_window = true;
|
||||
self.do_action(result.result, function () {
|
||||
// reload view
|
||||
self.widget_parent.reload();
|
||||
self.getParent().reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1111,8 +1111,8 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
|
|||
var self = this;
|
||||
var result_handler = function () {
|
||||
if (on_closed) { on_closed.apply(null, arguments); }
|
||||
if (self.widget_parent && self.widget_parent.on_action_executed) {
|
||||
return self.widget_parent.on_action_executed.apply(null, arguments);
|
||||
if (self.getParent() && self.getParent().on_action_executed) {
|
||||
return self.getParent().on_action_executed.apply(null, arguments);
|
||||
}
|
||||
};
|
||||
var context = new session.web.CompoundContext(dataset.get_context(), action_data.context || {});
|
||||
|
@ -1184,8 +1184,8 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
|
|||
this.$element.hide();
|
||||
},
|
||||
do_push_state: function(state) {
|
||||
if (this.widget_parent && this.widget_parent.do_push_state) {
|
||||
this.widget_parent.do_push_state(state);
|
||||
if (this.getParent() && this.getParent().do_push_state) {
|
||||
this.getParent().do_push_state(state);
|
||||
}
|
||||
},
|
||||
do_load_state: function(state, warm) {
|
||||
|
|
|
@ -238,8 +238,8 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
|
|||
this.$element.html(rendered);
|
||||
},
|
||||
do_reload: function() {
|
||||
var view_manager = this.view.widget_parent,
|
||||
action_manager = view_manager.widget_parent;
|
||||
var view_manager = this.view.getParent(),
|
||||
action_manager = view_manager.getParent();
|
||||
this.view.stop();
|
||||
action_manager.do_action(view_manager.action);
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({
|
|||
});
|
||||
})
|
||||
.delegate('li:not(.oe-done)', 'click', function () {
|
||||
self.widget_parent.widget_parent.widget_parent.do_execute_action({
|
||||
self.getParent().getParent().getParent().do_execute_action({
|
||||
type: 'object',
|
||||
name: 'action_launch'
|
||||
}, self.dataset,
|
||||
|
|
|
@ -97,7 +97,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
|||
this.$element.html(QWeb.render("GraphView", {
|
||||
"fields_view": this.fields_view,
|
||||
"chart": this.chart,
|
||||
'element_id': this.widget_parent.element_id
|
||||
'element_id': this.getParent().element_id
|
||||
}));
|
||||
|
||||
var fields = _(this.columns).pluck('name').concat([this.abscissa]);
|
||||
|
@ -272,7 +272,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
|||
self.renderer = null;
|
||||
var charts = new dhtmlXChart({
|
||||
view: view_chart,
|
||||
container: self.widget_parent.element_id+"-"+self.chart+"chart",
|
||||
container: self.getParent().element_id+"-"+self.chart+"chart",
|
||||
value:"#"+group_list[0].group+"#",
|
||||
gradient: (self.chart == "bar") ? "3d" : "light",
|
||||
alpha: (self.chart == "area") ? 0.6 : 1,
|
||||
|
@ -309,8 +309,8 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
|||
}
|
||||
}
|
||||
});
|
||||
self.$element.find("#"+self.widget_parent.element_id+"-"+self.chart+"chart").width(
|
||||
self.$element.find("#"+self.widget_parent.element_id+"-"+self.chart+"chart").width()+120);
|
||||
self.$element.find("#"+self.getParent().element_id+"-"+self.chart+"chart").width(
|
||||
self.$element.find("#"+self.getParent().element_id+"-"+self.chart+"chart").width()+120);
|
||||
|
||||
for (var m = 1; m<group_list.length;m++){
|
||||
var column = group_list[m];
|
||||
|
@ -333,8 +333,8 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
|||
});
|
||||
}
|
||||
charts.parse(results, "json");
|
||||
self.$element.find("#"+self.widget_parent.element_id+"-"+self.chart+"chart").height(
|
||||
self.$element.find("#"+self.widget_parent.element_id+"-"+self.chart+"chart").height()+50);
|
||||
self.$element.find("#"+self.getParent().element_id+"-"+self.chart+"chart").height(
|
||||
self.$element.find("#"+self.getParent().element_id+"-"+self.chart+"chart").height()+50);
|
||||
charts.attachEvent("onItemClick", function(id) {
|
||||
self.open_list_view(charts.get(id));
|
||||
});
|
||||
|
@ -354,7 +354,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
|||
self.renderer = null;
|
||||
var chart = new dhtmlXChart({
|
||||
view:"pie3D",
|
||||
container:self.widget_parent.element_id+"-piechart",
|
||||
container:self.getParent().element_id+"-piechart",
|
||||
value:"#"+self.ordinate+"#",
|
||||
pieInnerText:function(obj) {
|
||||
var sum = chart.sum("#"+self.ordinate+"#");
|
||||
|
@ -406,8 +406,8 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
|||
}
|
||||
|
||||
var views;
|
||||
if (this.widget_parent.action) {
|
||||
views = this.widget_parent.action.views;
|
||||
if (this.getParent().action) {
|
||||
views = this.getParent().action.views;
|
||||
if (!_(views).detect(function (view) {
|
||||
return view[1] === 'list' })) {
|
||||
views = [[false, 'list']].concat(views);
|
||||
|
|
|
@ -12,7 +12,7 @@ openerp.web_process = function (openerp) {
|
|||
},
|
||||
process_check: function() {
|
||||
var self = this,
|
||||
grandparent = this.widget_parent && this.widget_parent.widget_parent,
|
||||
grandparent = this.getParent() && this.getParent().getParent(),
|
||||
view = this.views[this.views_src[0].view_type],
|
||||
$process_view = this.$element.find('.oe-process-view');
|
||||
if (!(grandparent instanceof openerp.web.WebClient) ||
|
||||
|
@ -128,7 +128,7 @@ openerp.web_process = function (openerp) {
|
|||
this.$element.find('#edit_process').click(function() {
|
||||
self.edit_process_view();
|
||||
});
|
||||
var $parent = this.widget_parent.$element;
|
||||
var $parent = this.getParent().$element;
|
||||
$parent.find('#change_process').click(function() {
|
||||
self.process_selection = false,
|
||||
self.process_id = $parent.find('#select_process').val(),
|
||||
|
|
Loading…
Reference in New Issue