summaryrefslogtreecommitdiff
path: root/addons/base/static/src/js/data.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-05-27 17:10:00 +0200
committerXavier Morel <xmo@openerp.com>2011-05-27 17:10:00 +0200
commitdd3c1645ec27f64f0684bb7929abb6d1273ce1f7 (patch)
treec88b10c72731d9833092c074c8486a0ba9656015 /addons/base/static/src/js/data.js
parentd7e17b06cfbfdf77b4ec7e4ff6e8a1efd66f4075 (diff)
[FIX] m2m fields display
* Add reload_content method to ListView so third parties can ask for a redisplay * Add a StaticDataGroup descendant class to DataGroup (actually to GrouplessDataGroup as it can not contain groups, only records via a static data set) * Fix DataSetStatic.read_ids when no limit provided * Fix Many2ManyListView usage and overriding of a few ListView methods (due to ListView API changing) bzr revid: xmo@openerp.com-20110527151000-lq5a6sfohprs9gvs
Diffstat (limited to 'addons/base/static/src/js/data.js')
-rw-r--r--addons/base/static/src/js/data.js37
1 files changed, 21 insertions, 16 deletions
diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js
index 60bffc8bff3..7582e99b662 100644
--- a/addons/base/static/src/js/data.js
+++ b/addons/base/static/src/js/data.js
@@ -10,9 +10,7 @@ openerp.base.DataGroup = openerp.base.Controller.extend( /** @lends openerp.bas
* (a session, a model, a domain, a context and a group_by sequence), the
* domain and context may be empty. It is then interacted with via
* :js:func:`~openerp.base.DataGroup.list`, which is used to read the
- * content of the current grouping level, and
- * :js:func:`~openerp.base.DataGroup.get`, which is used to fetch an item
- * of the current grouping level.
+ * content of the current grouping level.
*
* @constructs
* @extends openerp.base.Controller
@@ -204,6 +202,24 @@ openerp.base.GrouplessDataGroup = openerp.base.DataGroup.extend(
}
});
+openerp.base.StaticDataGroup = openerp.base.GrouplessDataGroup.extend(
+ /** @lends openerp.base.StaticDataGroup# */ {
+ /**
+ * A specialization of groupless data groups, relying on a single static
+ * dataset as its records provider.
+ *
+ * @constructs
+ * @extends openerp.base.GrouplessDataGroup
+ * @param {openep.base.DataSetStatic} dataset a static dataset backing the groups
+ */
+ init: function (dataset) {
+ this.dataset = dataset;
+ },
+ list: function (ifGroups, ifRecords) {
+ ifRecords(this.dataset);
+ }
+});
+
openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base.DataSet# */{
/**
* DateaManagement interface between views and the collection of selected
@@ -334,7 +350,8 @@ openerp.base.DataSetStatic = openerp.base.DataSet.extend({
this.count = 0;
},
read_slice: function (fields, offset, limit, callback) {
- this.read_ids(this.ids.slice(offset, offset + limit));
+ var end_pos = limit && limit !== -1 ? offset + limit : undefined;
+ this.read_ids(this.ids.slice(offset, end_pos), fields, callback);
}
});
@@ -408,18 +425,6 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({
}
});
-openerp.base.DataSetRelational = openerp.base.DataSet.extend( /** @lends openerp.base.DataSet# */{
-});
-
-openerp.base.DataSetMany2Many = openerp.base.DataSetStatic.extend({
- /* should extend DataSetStatic instead, but list view still does not support it
- */
-
- unlink: function(ids) {
- // just do nothing
- }
-});
-
};
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: