summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-03-08 16:03:28 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit228e18e81ae2439c307825cd8127e800dfec571c (patch)
tree61219a17a268be24cac236b4d517b0364d59dd88 /addons/web/static/src/js/fields
parent61b09bbe47ca88f411840778a2134d8c7f860338 (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/fields')
-rw-r--r--addons/web/static/src/js/fields/abstract_field.js3
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js2
2 files changed, 2 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js
index 57a3ea00941..e1ff2e8cca9 100644
--- a/addons/web/static/src/js/fields/abstract_field.js
+++ b/addons/web/static/src/js/fields/abstract_field.js
@@ -31,7 +31,6 @@ odoo.define('web.AbstractField', function (require) {
*/
var field_utils = require('web.field_utils');
-var pyeval = require('web.pyeval');
var Widget = require('web.Widget');
var Domain = require('web.Domain');
@@ -114,7 +113,7 @@ var AbstractField = Widget.extend({
// Widget can often be configured in the 'options' attribute in the
// xml 'field' tag. These options are saved (and evaled) in nodeOptions
- this.nodeOptions = pyeval.py_eval(this.attrs.options || '{}', this.recordData);
+ this.nodeOptions = this.attrs.options || {};
// dataPointID is the id corresponding to the current record in the model.
// Its intended use is to be able to tag any messages going upstream,
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index f4c55c25202..0aa6b3440bc 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -222,7 +222,7 @@ var FieldMany2One = AbstractField.extend({
// really a bad way to do it. Now, we need to remove the extra lines
// and hope for the best that noone tries to uses this mechanism to do
// something else.
- if (this.field.__always_reload) {
+ if (this.nodeOptions.always_reload) {
value = value.split('\n')[0];
}
this.$input.val(value);