[MERGE] forward port of latest saas-2 until rev 3893 dle@openerp.com-20131218112416-2vtaq442qo8opq4u

bzr revid: mat@openerp.com-20131218165033-4djghawrzllkeckg
This commit is contained in:
Martin Trigaux 2013-12-18 17:50:33 +01:00
commit 07f2a7c1f9
4 changed files with 15 additions and 15 deletions

View File

@ -256,7 +256,7 @@ instance.web.CrashManager = instance.web.Class.extend({
new (handler)(this, error).display();
return;
}
if (error.data.name === "openerp.addons.web.session SessionExpiredException") {
if (error.data.name === "openerp.http.SessionExpiredException") {
this.show_warning({type: "Session Expired", data: { message: _t("Your OpenERP session expired. Please refresh the current web page.") }});
return;
}

View File

@ -1155,7 +1155,7 @@ openerp.Model = openerp.Class.extend({
kwargs = args;
args = [];
}
var call_kw = _.str.sprintf('/web/dataset/call_kw/%s/%s', this.name, method);
var call_kw = '/web/dataset/call_kw/' + this.name + '/' + method;
return this.session().rpc(call_kw, {
model: this.name,
method: method,

View File

@ -1386,25 +1386,25 @@ instance.web.View = instance.web.Widget.extend({
return self.getParent().on_action_executed.apply(null, arguments);
}
};
var context = dataset.get_context();
if (action_data.model !== dataset.model) {
// filter out context keys that are specific to the action model.
// Wrong default_ and search_default values will no give the expected views
// Wrong group_by values will simply fail and forbid rendering of the destination view
context = _.object(_.reject(_.pairs(context.eval()), function(pair) {
return pair[0].match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf)$') !== null;
}));
}
var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {});
context = new instance.web.CompoundContext(context, action_data.context || {});
// response handler
var handler = function (action) {
if (action && action.constructor == Object) {
var ncontext = new instance.web.CompoundContext(context);
// filter out context keys that are specific to the current action.
// Wrong default_* and search_default_* values will no give the expected result
// Wrong group_by values will simply fail and forbid rendering of the destination view
var ncontext = new instance.web.CompoundContext(
_.object(_.reject(_.pairs(dataset.get_context().eval()), function(pair) {
return pair[0].match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
}))
);
ncontext.add(action_data.context || {});
ncontext.add({active_model: dataset.model});
if (record_id) {
ncontext.add({
active_id: record_id,
active_ids: [record_id],
active_model: dataset.model
});
}
ncontext.add(action.context || {});

View File

@ -14,5 +14,5 @@ This widget allows to display gauges using justgage library.
],
'qweb': [
],
'auto_install': False,
'auto_install': True,
}