diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-05-17 09:22:40 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-05-17 12:36:16 +0200 |
| commit | ba6a3a91ae78297c7f8ddcf7630ecef46048c15e (patch) | |
| tree | e34d22ff2043cc8489bced9ec0f46f1e9869067d /addons/web/static/src/js/fields | |
| parent | 59584283c52f06a478e61e93b1d0f69a750a1768 (diff) | |
[FIX] web: MonetaryField: read currency_field in options
In the xml definition of views, a 'currency_field' can be specified
in the node options:
<field name="amount" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
It indicates which field the monetary widget has to use to
determine the currency to display.
Before this rev., the widget didn't look for the 'currency_field'
in the options, but directly in the node attrs, so this simply
didn't work. This was for example the case on the crm.lead kanban
and form views.
Diffstat (limited to 'addons/web/static/src/js/fields')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 6f757e5414e..b35b84fe6ee 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -548,7 +548,7 @@ var FieldMonetary = InputField.extend({ * @private */ _setCurrency: function () { - var currencyField = this.attrs.currency_field || this.field.currency_field || 'currency_id'; + var currencyField = this.nodeOptions.currency_field || this.field.currency_field || 'currency_id'; var currencyID = this.record.data[currencyField] && this.record.data[currencyField].res_id; this.currency = session.get_currency(currencyID); }, |
