[FIX] set action domain in the SearchDataSet in ViewManagerAction, use that to query the first treeview level
bzr revid: xmo@openerp.com-20110809081136-1q1nowzq4xj4jcwu
This commit is contained in:
parent
05a9546794
commit
864e850e97
|
@ -50,7 +50,6 @@ openerp.base.TreeView = openerp.base.View.extend({
|
|||
});
|
||||
this.fields = fields_view.fields;
|
||||
|
||||
self.dataset.domain = [['parent_id', '=', '']];
|
||||
this.dataset.read_slice([], 0, false, function (response) {
|
||||
self.$element.html(QWeb.render('TreeView', {
|
||||
"first_level": response,
|
||||
|
|
|
@ -264,11 +264,11 @@ openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({
|
|||
init: function(session, element_id, action) {
|
||||
var dataset;
|
||||
if (!action.res_id) {
|
||||
dataset = new openerp.base.DataSetSearch(session, action.res_model, action.context || null);
|
||||
dataset = new openerp.base.DataSetSearch(session, action.res_model, action.context || null, action.domain || null);
|
||||
} else {
|
||||
dataset = new openerp.base.DataSetStatic(session, action.res_model, {}, [action.res_id]);
|
||||
if (action.context) {
|
||||
// TODO fme: should normalize all DataSets constructors to (session, model, context, ...)
|
||||
// TODO fme: should normalize all DataSets constructors to (session, model, context, domain, ...)
|
||||
dataset.context = action.context;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue