[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:
Xavier Morel 2011-08-09 10:11:36 +02:00
parent 05a9546794
commit 864e850e97
2 changed files with 2 additions and 3 deletions

View File

@ -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,

View File

@ -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;
}
}