diff --git a/addons/web/static/src/legacy/js/fields/basic_fields.js b/addons/web/static/src/legacy/js/fields/basic_fields.js index 2efd6738fef..c9b73940ab8 100644 --- a/addons/web/static/src/legacy/js/fields/basic_fields.js +++ b/addons/web/static/src/legacy/js/fields/basic_fields.js @@ -1258,7 +1258,7 @@ var FieldMonetary = NumericField.extend({ // Prepare and add the input var def = this._prepareInput(this.$input).appendTo(this.$el); - if (this.currency) { + if (this.currency && !this.nodeOptions.no_symbol) { // Prepare and add the currency symbol var $currencySymbol = $('', {text: this.currency.symbol}); if (this.currency.position === "after") { diff --git a/addons/web/static/tests/legacy/fields/basic_fields_tests.js b/addons/web/static/tests/legacy/fields/basic_fields_tests.js index 3ff7545ce4c..451b73ada70 100644 --- a/addons/web/static/tests/legacy/fields/basic_fields_tests.js +++ b/addons/web/static/tests/legacy/fields/basic_fields_tests.js @@ -5782,6 +5782,33 @@ QUnit.module('basic_fields', { form.destroy(); }); + QUnit.test('monetary field without currency symbol', async function (assert) { + assert.expect(1); + + var form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'
' + + '' + + '' + + '' + + '' + + '
', + res_id: 5, + session: { + currencies: _.indexBy(this.data.currency.records, 'id'), + }, + }); + + await testUtils.form.clickEdit(form); + + // Non-breaking space between the currency and the amount + assert.strictEqual(form.$('.o_field_widget[name=qux] input').val(), "9.10", "The currency symbol is not displayed"); + + form.destroy(); + }); + QUnit.test('monetary field in editable list view', async function (assert) { assert.expect(9);