From 9e8b8d1bf7da49863f31e20b521447431e4eb065 Mon Sep 17 00:00:00 2001 From: "Mahdi Cheikh Rouhou (macr)" Date: Wed, 23 Aug 2023 11:49:35 +0000 Subject: [PATCH] [FIX] account, web : display monetary and numbers in rtl language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: ====== - Display of monetary values in kanban views is wrong in rtl language - Pivot display has multiple erros in rtl language: values are left aligned and they are supposed to be right aligned like in ltr lang, negative numbers has the sign in the wrong place, the (plus/minus) icon placement is wrong (it should be before the title and not after) Steps to reproduce the error: ============================= - Install accounting and rlt language (arabic for example) - Go to accounting (display of monetary fields is wrong) - Go to accounting/accounting/journal items/pivot view - Choose residual amount in view (it has some negative values) Solution: ========= Kanban Solution: - I fixed the direction of the display to be ltr always for monetary values and added the class to the appropriate tags. Pivot Solution: - I fixed the direction and text-align style for the values to always display the same like rtl. - displaying the icon and then the title will always give the desired display since the direction will reverse their order itself when it's rtl enterprise fix : https://github.com/odoo/enterprise/pull/46675 opw-3295573 closes odoo/odoo#134296 X-original-commit: 6b7f89b43b6abc970c955760da203a1e41c53652 Related: odoo/enterprise#46900 Signed-off-by: de Wouters de Bouchout Jean-BenoƮt (jbw) Signed-off-by: Mahdi Cheikh Rouhou (macr) --- .../views/account_journal_dashboard_view.xml | 14 +++++++------- .../static/src/views/kanban/kanban_controller.scss | 9 +++++++++ .../web/static/src/views/pivot/pivot_renderer.xml | 5 ++--- addons/web/static/src/views/pivot/pivot_view.scss | 7 +++++++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index 227d0e2c437..0908fe41964 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -230,7 +230,7 @@ to check
- +
@@ -266,7 +266,7 @@ Balance
- +
@@ -275,7 +275,7 @@ Last Statement
- +
@@ -325,7 +325,7 @@
- +
@@ -341,7 +341,7 @@
- +
@@ -352,7 +352,7 @@
- +
@@ -361,7 +361,7 @@ to check
- +
diff --git a/addons/web/static/src/views/kanban/kanban_controller.scss b/addons/web/static/src/views/kanban/kanban_controller.scss index 593b40e0139..bf637c4eb38 100644 --- a/addons/web/static/src/views/kanban/kanban_controller.scss +++ b/addons/web/static/src/views/kanban/kanban_controller.scss @@ -654,6 +654,15 @@ width: $o-kanban-color-border-width; z-index: 1; // show the title over kanban color } + + .o_field_monetary, .o_kanban_monetary { + /*rtl:ignore*/ + direction: ltr; + } + + span.o_kanban_monetary { + display: inline-block; + } } .o_kanban_mobile .o_kanban_renderer .o_kanban_record { diff --git a/addons/web/static/src/views/pivot/pivot_renderer.xml b/addons/web/static/src/views/pivot/pivot_renderer.xml index 4dd5c1755cc..573e49bc281 100644 --- a/addons/web/static/src/views/pivot/pivot_renderer.xml +++ b/addons/web/static/src/views/pivot/pivot_renderer.xml @@ -28,7 +28,7 @@ - this.onAddCustomGroupBy(isXAxis ? 'col' : 'row', cell.groupId, fieldName)" /> - - + diff --git a/addons/web/static/src/views/pivot/pivot_view.scss b/addons/web/static/src/views/pivot/pivot_view.scss index ffe7a54d024..8d066fa4dd4 100644 --- a/addons/web/static/src/views/pivot/pivot_view.scss +++ b/addons/web/static/src/views/pivot/pivot_view.scss @@ -22,6 +22,13 @@ .o_pivot_cell_value.o_cell_hover { background-color: $table-hover-bg; } + + .o_pivot_cell_value { + /*rtl:ignore*/ + text-align: right !important; + /*rtl:ignore*/ + direction: ltr; + } } .o_pivot_view {