diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-03-08 16:03:28 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 228e18e81ae2439c307825cd8127e800dfec571c (patch) | |
| tree | 61219a17a268be24cac236b4d517b0364d59dd88 /addons/web/static/src/js/views/basic/basic_view.js | |
| parent | 61b09bbe47ca88f411840778a2134d8c7f860338 (diff) | |
[REF] web, mail: include evaled field options in datapoint
Field options do not depend on any context/data. They can so be
"computed" once and for all in the BasicView implementation instead
of in the AbstractField's one.
Also, remove the flag __always_reload and leave it be in the
options object (always_reload).
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_view.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_view.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_view.js b/addons/web/static/src/js/views/basic/basic_view.js index d8e41b99835..d493bcb9729 100644 --- a/addons/web/static/src/js/views/basic/basic_view.js +++ b/addons/web/static/src/js/views/basic/basic_view.js @@ -164,12 +164,10 @@ var BasicView = AbstractView.extend({ * @param {Object} attrs */ _processField: function (field, node, attrs) { - if (attrs.options) { - var options = pyeval.py_eval(attrs.options || '{}'); - if (options.always_reload) { - field.__always_reload = true; - } + if (!_.isObject(attrs.options)) { // parent arch could have already been processed (TODO this should not happen) + attrs.options = attrs.options ? pyeval.py_eval(attrs.options) : {}; } + if (field.type === 'many2one') { if (node.attrs.widget === 'statusbar' || node.attrs.widget === 'radio') { field.__fetch_status = true; |
