From 228e18e81ae2439c307825cd8127e800dfec571c Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 8 Mar 2017 16:03:28 +0100 Subject: [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). --- addons/web/static/src/js/views/basic/basic_view.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src/js/views/basic/basic_view.js') 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; -- cgit v1.2.3