summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-09-13 08:31:21 +0200
committerXavier Morel <xmo@openerp.com>2011-09-13 08:31:21 +0200
commit9e3fe8e471f29d3fae6fe1e96df2e707bb37a058 (patch)
tree0fd33359bf5e146bacb1b4e64c3b0280d517d243 /addons/web/static
parent1605fb8f50809a382956689eff7b8f009a4542c3 (diff)
[FIX] issues with list not being a primary action view
* ViewManagerAction should always instantiate a DataSetSearch, if there's a res_id add it to the DataSet * Always define a base DataGroup (groupless) on the ListView's groups, so it can be shown() without a search (will just use default dataset parameters) lp bug: https://launchpad.net/bugs/847849 fixed bzr revid: xmo@openerp.com-20110913063121-ry2cuwiuqfo655xe
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/list.js7
-rw-r--r--addons/web/static/src/js/views.js9
2 files changed, 10 insertions, 6 deletions
diff --git a/addons/web/static/src/js/list.js b/addons/web/static/src/js/list.js
index b9df9e8e2df..cca616d0055 100644
--- a/addons/web/static/src/js/list.js
+++ b/addons/web/static/src/js/list.js
@@ -61,6 +61,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
if (this.dataset instanceof openerp.web.DataSetStatic) {
this.groups.datagroup = new openerp.web.StaticDataGroup(this.dataset);
+ } else {
+ this.groups.datagroup = new openerp.web.DataGroup(
+ this, this.model,
+ dataset.get_domain(),
+ dataset.get_context(),
+ {});
+ this.groups.datagroup.sort = this.dataset._sort;
}
this.page = 0;
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index c4309a42e38..2ae20051853 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -302,12 +302,9 @@ openerp.web.ViewManagerAction = openerp.web.ViewManager.extend({
init: function(parent, action) {
this.session = parent.session;
this.action = action;
- var dataset;
- if (!action.res_id) {
- dataset = new openerp.web.DataSetSearch(this, action.res_model, action.context, action.domain);
- } else {
- this.action.flags.search_view = false;
- dataset = new openerp.web.DataSetStatic(this, action.res_model, action.context, [action.res_id]);
+ var dataset = new openerp.web.DataSetSearch(this, action.res_model, action.context, action.domain);
+ if (action.res_id) {
+ dataset.ids.push(action.res_id);
dataset.index = 0;
}
this._super(parent, dataset, action.views);