[IMP] sidebar: when cliking on an item, add active_domain along with active_id and active_ids. This domain is taken from the search view.
bzr revid: tde@openerp.com-20130722112338-iws5ffxi77ykdvlu
This commit is contained in:
parent
6021f031e5
commit
0a1db46398
|
@ -1183,25 +1183,39 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
||||||
var active_ids_context = {
|
var active_ids_context = {
|
||||||
active_id: ids[0],
|
active_id: ids[0],
|
||||||
active_ids: ids,
|
active_ids: ids,
|
||||||
active_model: self.getParent().dataset.model
|
active_model: self.getParent().dataset.model,
|
||||||
};
|
};
|
||||||
var c = instance.web.pyeval.eval('context',
|
|
||||||
|
var search_view = self.getParent().ViewManager.searchview;
|
||||||
|
var search_data = search_view.build_search_data();
|
||||||
|
var active_domain_done = instance.web.pyeval.eval_domains_and_contexts({
|
||||||
|
domains: search_data.domains,
|
||||||
|
contexts: search_data.contexts,
|
||||||
|
group_by_seq: search_data.groupbys || []
|
||||||
|
}).done(function (results) {
|
||||||
|
active_ids_context['active_domain'] = results.domain;
|
||||||
|
});
|
||||||
|
|
||||||
|
$.when(active_domain_done).done(function () {
|
||||||
|
var c = instance.web.pyeval.eval('context',
|
||||||
new instance.web.CompoundContext(
|
new instance.web.CompoundContext(
|
||||||
sidebar_eval_context, active_ids_context));
|
sidebar_eval_context, active_ids_context));
|
||||||
self.rpc("/web/action/load", {
|
|
||||||
action_id: item.action.id,
|
self.rpc("/web/action/load", {
|
||||||
context: c
|
action_id: item.action.id,
|
||||||
}).done(function(result) {
|
context: c
|
||||||
result.context = new instance.web.CompoundContext(
|
}).done(function(result) {
|
||||||
result.context || {}, active_ids_context)
|
result.context = new instance.web.CompoundContext(
|
||||||
.set_eval_context(c);
|
result.context || {}, active_ids_context)
|
||||||
result.flags = result.flags || {};
|
.set_eval_context(c);
|
||||||
result.flags.new_window = true;
|
result.flags = result.flags || {};
|
||||||
self.do_action(result, {
|
result.flags.new_window = true;
|
||||||
on_close: function() {
|
self.do_action(result, {
|
||||||
// reload view
|
on_close: function() {
|
||||||
self.getParent().reload();
|
// reload view
|
||||||
},
|
self.getParent().reload();
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue