From e95b4e959433db45bc5c227f67763cd509fee333 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 7 Jan 2019 09:25:12 +0000 Subject: [FIX] web: graph view translation The control labels 'Grouped' and 'Stacked' are not translated since they are default values from nvd3. opw-1908220 closes odoo/odoo#29975 --- addons/web/static/src/js/views/graph/graph_renderer.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/graph/graph_renderer.js b/addons/web/static/src/js/views/graph/graph_renderer.js index 5deba9d69bd..5ec89635dc8 100644 --- a/addons/web/static/src/js/views/graph/graph_renderer.js +++ b/addons/web/static/src/js/views/graph/graph_renderer.js @@ -210,6 +210,10 @@ return AbstractRenderer.extend({ margin: {left: 80, bottom: 100, top: 80, right: 0}, delay: 100, transition: 10, + controlLabels: { + 'grouped': _t('Grouped'), + 'stacked': _t('Stacked'), + }, showLegend: _.size(data) <= MAX_LEGEND_LENGTH, showXAxis: true, showYAxis: true, -- cgit v1.2.3 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') 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 07befd19a7b9ffb4b8174502c124bb5e97112fa8 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 7 Jan 2019 13:06:38 +0000 Subject: [FIX] web: make pie chart title translatable The Pie Chart title is not translatable, since a string defined in a `t-att-` cannot be translated. We use the attribute `title` instead. Tests are adapted in https://github.com/odoo/enterprise/pull/3379 opw-1908220 closes odoo/odoo#29991 --- addons/web/static/src/js/widgets/pie_chart.js | 1 + addons/web/static/src/xml/pie_chart.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/widgets/pie_chart.js b/addons/web/static/src/js/widgets/pie_chart.js index 663e2b4cc98..c483c23c73d 100644 --- a/addons/web/static/src/js/widgets/pie_chart.js +++ b/addons/web/static/src/js/widgets/pie_chart.js @@ -31,6 +31,7 @@ var PieChart = Widget.extend({ Domain.prototype.stringToArray(modifiers.domain || '[]')); var arch = qweb.render('web.PieChart', { modifiers: modifiers, + title: node.attrs.title || modifiers.title || modifiers.measure, }); this.subViewParams = { diff --git a/addons/web/static/src/xml/pie_chart.xml b/addons/web/static/src/xml/pie_chart.xml index 5c3411bc882..d45bef7af6f 100644 --- a/addons/web/static/src/xml/pie_chart.xml +++ b/addons/web/static/src/xml/pie_chart.xml @@ -1,7 +1,7 @@