[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user