diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-03-09 15:12:58 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 49f7a9f657b011080666475f836982665615dc7c (patch) | |
| tree | 297819c867d76d703773882660fd7319d3538cb4 /addons/mail/static/src/js/basic_view.js | |
| parent | 228e18e81ae2439c307825cd8127e800dfec571c (diff) | |
[REF] web, mail: use field registry in views, not renderers
Before this commit, the AbstractField specialization to use to
instantiate a field was determined in the renderers. Now this is
regrouped in BasicView.
Note: renderers are still left free to not use the determined
Class (like Kanban and not editable List which instantiate widgets
only if the "widget" attribute is present).
Diffstat (limited to 'addons/mail/static/src/js/basic_view.js')
| -rw-r--r-- | addons/mail/static/src/js/basic_view.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/addons/mail/static/src/js/basic_view.js b/addons/mail/static/src/js/basic_view.js index 8143b77e954..624c66c0888 100644 --- a/addons/mail/static/src/js/basic_view.js +++ b/addons/mail/static/src/js/basic_view.js @@ -6,15 +6,24 @@ var BasicView = require('web.BasicView'); var mailWidgets = ['mail_followers', 'mail_thread', 'mail_activity', 'kanban_activity']; BasicView.include({ - init: function() { + init: function () { this.mailFields = {}; this._super.apply(this, arguments); this.rendererParams.activeActions = this.controllerParams.activeActions; this.rendererParams.mailFields = this.mailFields; }, - _processField: function(field, node) { - if (_.contains(mailWidgets, node.attrs.widget)) { - this.mailFields[node.attrs.widget] = node.attrs.name; + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * @param {Object} field - the field properties + * @param {Object} attrs - the field attributes (from the xml) + */ + _processField: function (field, attrs) { + if (_.contains(mailWidgets, attrs.widget)) { + this.mailFields[attrs.widget] = attrs.name; field.__no_fetch = true; } this._super.apply(this, arguments); |
