diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-03-16 13:55:42 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2016-03-18 10:44:52 +0100 |
| commit | 6c57935443d2abd4e3c7507cf4f3093719fb1c2f (patch) | |
| tree | 88971120ba2505ac90cc8428d57312742e2313bd /addons/web/static/src/js/framework/model.js | |
| parent | bda451ab31c19c52eb72c16eae2471d39860a8d3 (diff) | |
[IMP] openerp,web: cache of actions, fields(_views) and filters
Introduction of 'data_manager' service which handles meta-data related to
actions and views (fields_views, fields and filters). Ideally, all RPCs to
get that kind of information should go through data_manager, as it holds an
internal cache.
Diffstat (limited to 'addons/web/static/src/js/framework/model.js')
| -rw-r--r-- | addons/web/static/src/js/framework/model.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/addons/web/static/src/js/framework/model.js b/addons/web/static/src/js/framework/model.js index 8e37f14218e..fc1422d799a 100644 --- a/addons/web/static/src/js/framework/model.js +++ b/addons/web/static/src/js/framework/model.js @@ -3,7 +3,6 @@ odoo.define('web.Model', function (require) { var Class = require('web.Class'); var session = require('web.session'); -var utils = require('web.utils'); var Model = Class.extend({ /** @@ -70,43 +69,6 @@ var Model = Class.extend({ signal: signal }); }, - /** - * Performs a fields_view_get and apply postprocessing. - * return a {$.Deferred} resolved with the fvg - * - * @param {Object} args - * @param {String|Object} args.model instance.web.Model instance or string repr of the model - * @param {Object} [args.context] context if args.model is a string - * @param {Number} [args.view_id] id of the view to be loaded, default view if null - * @param {String} [args.view_type] type of view to be loaded if view_id is null - * @param {Boolean} [args.toolbar=false] get the toolbar definition - */ - fields_view_get: function (options) { - return this.call('fields_view_get', { - view_id: options.view_id, - view_type: options.view_type, - context: options.context, - toolbar: options.toolbar || false - }).then(this.postprocess_fvg.bind(this)); - }, - - postprocess_fvg: function (fvg) { - var self = this; - var doc = $.parseXML(fvg.arch).documentElement; - fvg.arch = utils.xml_to_json(doc, (doc.nodeName.toLowerCase() !== 'kanban')); - if ('id' in fvg.fields) { - // Special case for id's - var id_field = fvg.fields.id; - id_field.original_type = id_field.type; - id_field.type = 'id'; - } - _.each(fvg.fields, function(field) { - _.each(field.views || {}, function(view) { - self.postprocess_fvg(view); - }); - }); - return fvg; - }, }); return Model; |
