[FIX] web: on_item_action_clicked, self.dataset is not always defined.

27a48f8026 introduced the use of self.dataset
It appears it is not always defined.
Few lines above, self.getParent().dataset is used,
and looks to be always defined.
We therefore now use this dataset in order to get the context,
to correctly pass the current session language.

Closes #5416
This commit is contained in:
Denis Ledoux 2015-02-23 11:41:32 +01:00
parent 4305aad02f
commit 0bbd8351f1
1 changed files with 3 additions and 2 deletions

View File

@ -1210,10 +1210,11 @@ instance.web.Sidebar = instance.web.Widget.extend({
instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true });
return false;
}
var dataset = self.getParent().dataset;
var active_ids_context = {
active_id: ids[0],
active_ids: ids,
active_model: self.getParent().dataset.model
active_model: dataset.model
};
var c = instance.web.pyeval.eval('context',
new instance.web.CompoundContext(
@ -1221,7 +1222,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
self.rpc("/web/action/load", {
action_id: item.action.id,
context: new instance.web.CompoundContext(
self.dataset.get_context(), active_ids_context).eval()
dataset.get_context(), active_ids_context).eval()
}).done(function(result) {
result.context = new instance.web.CompoundContext(
result.context || {}, active_ids_context)