From 977db823c7c84e9edc7c8cf8384eb9cf47275b3a Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 8 Apr 2016 14:53:34 +0200 Subject: [REF] web: stop duplicating web Avoid duplicating web addon in enterprise by extracting a common basis. Enterprise features stay in enterprise, but use that common basis. Mainly: - JS refactoring and linting - Conversion of .sass into .less split into multiple files - Templates cleaning and DOM simplification - Re-generation of web.pot, and update of .po files --- addons/web/static/src/js/framework/data.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'addons/web/static/src/js/framework/data.js') diff --git a/addons/web/static/src/js/framework/data.js b/addons/web/static/src/js/framework/data.js index a1b8e1602e9..592e402d927 100644 --- a/addons/web/static/src/js/framework/data.js +++ b/addons/web/static/src/js/framework/data.js @@ -320,6 +320,7 @@ var DataSet = Class.extend(mixins.PropertiesMixin, { this.index = null; this._sort = []; this._model = new Model(model, context); + this.orderer = new utils.DropMisordered(); }, previous: function () { this.index -= 1; @@ -408,10 +409,11 @@ var DataSet = Class.extend(mixins.PropertiesMixin, { read_slice: function (fields, options) { var self = this; options = options || {}; - return this._model.query(fields) + var query = this._model.query(fields) .limit(options.limit || false) .offset(options.offset || 0) - .all().done(function (records) { + .all(); + return this.orderer.add(query).done(function (records) { self.ids = _(records).pluck('id'); }); }, @@ -761,12 +763,6 @@ var BufferedDataSet = DataSetStatic.extend({ _.extend(cached.from_read, options.from_read); _.extend(cached.changes, options.changes); _.extend(cached.readonly_fields, options.readonly_fields); - // discard values from cached.changes that are in cached.from_read - _.each(cached.changes, function (v, k) { - if (cached.from_read[k] === v) { - delete cached.changes[k]; - } - }); if (options.to_create !== undefined) cached.to_create = options.to_create; if (options.to_delete !== undefined) cached.to_delete = options.to_delete; } -- cgit v1.2.3