From 65a264ac6a266dbcea70cf59b65377fa0e73924b Mon Sep 17 00:00:00 2001 From: "Laurent Desausoi (lade)" Date: Mon, 28 Mar 2022 09:23:52 +0000 Subject: [PATCH] =?UTF-8?q?[FIX]=C2=A0sale:=20Cutoff=20fields=20in=20SO=20?= =?UTF-8?q?reports=20for=20RTL=20languages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The address in a SO report with RTL languages are cutoff, they overflow the layout of the PDF which makes the address unreadable. To reproduce the issue: 1. On runbot v15 > make a SO with the recipient in Arabic/Persian/Hebrew language (any language that is RTL) 2. Specify a different delivery/invoicing address than the recipient 3. Print the PDF Result: Part of the delivery address is cut off Solution: As for now, two CSS stylesheets are used in the HTML before transforming it to a PDF: *bootstrap.css* & *web.report_assets_common.min.css* (where the latter is mapped in RTL style with RTLCSS). Note that the *web.report_assets_common.min.css* import in itself the bootstrap style BEFORE the RTL mapping. Thus, they both define the `offset-1` class which is used by our problematic component in the HTML/PDF (a `margin-left` for the *bootstrap.css* and a `margin-right` for the *web.report_assets_common.min.css*). Consequently, these 2 margins makes the bootstrap `row` overflow. There are two different margin because the `margin-left` from *bootstrap.css* was translated into `margin-right` in the other CSS when doing the RTL mapping. A quick fix would be to override this undesired `margin-left` and make it null into the sale_report specific CSS style. While it would work, it does not resolve the underlying issue. In normal circumstances, the *bootstrap.css* should not be used into the report. It is in fact included because there is an error into the manifest of the web module (see permalink here-under). The issue comes from a file that was moved during the migration to the OWL framework (see commit 29731b4). In the end, both fix will be applied on all versions except master. We keep the quickfix in running versions to avoid requiring an update by the client but the quickfix will not be pushed to master. https://github.com/odoo/odoo/blob/95bcc8472c3f3ddc8a4c7c1ab4a97ddbd471dba0/odoo/addons/base/models/assetsbundle.py#L166 opw-2767445 closes odoo/odoo#88437 X-original-commit: b99df11f5ac2d4ca6e44d0f4963a600d3aef5a55 Signed-off-by: Anh Thao PHAM Signed-off-by: Desausoi Laurent (lade) --- addons/web/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index 81ede0229df..9e87df8b27b 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -283,7 +283,7 @@ This module provides the core of the Odoo Web Client. 'web/static/src/legacy/js/report/report.js', ], 'web.report_assets_pdf': [ - 'web/static/src/css/reset.min.css', + 'web/static/src/legacy/js/report/reset.min.css', ], # ---------------------------------------------------------------------