From 69f6b9510db36570698e472f797ef5e4e3685d2e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 8 Jan 2019 13:15:16 +0000 Subject: [FIX] web: decimal separator of percentage When a percentage if formatted, the decimal separator used is always `.`, while it should be the decimal separator of the language. opw-1908220 closes odoo/odoo#30030 --- addons/web/static/src/js/fields/field_utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/field_utils.js b/addons/web/static/src/js/fields/field_utils.js index bbdee83c4f9..ec99f4fa0f6 100644 --- a/addons/web/static/src/js/fields/field_utils.js +++ b/addons/web/static/src/js/fields/field_utils.js @@ -363,7 +363,7 @@ function formatPercentage(value, field, options) { if (options.humanReadable && options.humanReadable(value * 100)) { return result + "%"; } - return parseFloat(result) + "%"; + return (parseFloat(result) + "%").replace('.', _t.database.parameters.decimal_point); } /** * Returns a string representing the value of the selection. -- cgit v1.2.3 From 01cd87794df21d0984140a433e6fdbe5ff5234e5 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Thu, 17 Jan 2019 10:16:56 +0000 Subject: [FIX] web: remove the report_layout from studio selectable widgets Open studio to modify the widget displaying a relational field. The report_layout widget can be selected, say, to display payment terms. Obviously it doesn't make sense. We remove its supported field, as the field is not generic (indeed there is only one use for it in the codebase). opw 1919369 closes odoo/odoo#30303 --- addons/web/static/src/js/fields/special_fields.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/special_fields.js b/addons/web/static/src/js/fields/special_fields.js index 90c4f589989..3d65b83039e 100644 --- a/addons/web/static/src/js/fields/special_fields.js +++ b/addons/web/static/src/js/fields/special_fields.js @@ -122,7 +122,8 @@ var FieldTimezoneMismatch = FieldSelection.extend({ }); var FieldReportLayout = relational_fields.FieldMany2One.extend({ - supportedFieldTypes: ['many2one', 'selection'], + // this widget is not generic, so we disable its studio use + // supportedFieldTypes: ['many2one', 'selection'], events: _.extend({}, relational_fields.FieldMany2One.prototype.events, { 'click img': '_onImgClicked', }), -- cgit v1.2.3