diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-06-15 12:37:42 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-06-16 11:14:16 +0200 |
| commit | 8859d25bc5b719734b7d02bc26adfd38dca79e56 (patch) | |
| tree | 6106160ae2da305999149bbc141950442d802e26 /addons/web/static/src/js/fields/relational_fields.js | |
| parent | 1fa67917ba648bc15f5a895f6bdcea173e2a7258 (diff) | |
[FIX] web: FieldWidgets: use correct format/parse functions
Field widgets must format and parse values according to the widget
type, not to the field type. For example, if a monetary field is
inserted in a form view with widget="float", the field's value must
be formatted with the float formatter, not the montetary one. This
wasn't the case before this rev.
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 3b47b8c64b0..95bef29f88e 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -1763,6 +1763,7 @@ var FieldSelection = AbstractField.extend({ this._super.apply(this, arguments); if (this.field.type === 'many2one') { this.values = this.record.specialData[this.name]; + this.formatType = 'many2one'; } else { this.values = _.reject(this.field.selection, function (v) { return v[0] === false && v[1] === ''; |
