From 91399aed95f21fa3148c19db1f48a94897feb95e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 2 Aug 2019 13:26:32 +0000 Subject: [PATCH] [FIX] web: RTL on list view - Set the user language to a RTL language, e.g. Arabic - Open a list view containing float or monetary fields, e.g. the invoice list view The numbers are left aligned while the corresponding columns headers are right aligned, making the list view confusing. The header alignment is hardcoded at rendering rather than in the SCSS. Therefore, `rtlcss` doesn't affect it. Instead of hardcoding the alignment, we use a proper CSS class so it is adapted by `rtlcss`. opw-2044019 closes odoo/odoo#35414 Signed-off-by: Nicolas Martinelli (nim) --- addons/web/static/src/js/views/list/list_renderer.js | 2 +- addons/web/static/src/scss/list_view.scss | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js index b343f044bc2..ed224598f76 100644 --- a/addons/web/static/src/js/views/list/list_renderer.js +++ b/addons/web/static/src/js/views/list/list_renderer.js @@ -560,7 +560,7 @@ var ListRenderer = BasicRenderer.extend({ } if (field.type === 'float' || field.type === 'integer' || field.type === 'monetary') { - $th.css({ textAlign: 'right' }); + $th.addClass('o_list_number_th'); } if (config.debug) { diff --git a/addons/web/static/src/scss/list_view.scss b/addons/web/static/src/scss/list_view.scss index 2933850b9f4..5b0f4cd9200 100644 --- a/addons/web/static/src/scss/list_view.scss +++ b/addons/web/static/src/scss/list_view.scss @@ -31,6 +31,9 @@ &:not(.o_column_sortable):hover { cursor: default; } + &.o_list_number_th { + text-align: right; + } } }