odoo/odoo#172798

Created by fw-bot
Closed
label
odoo-dev:saas-17.4-17.0-opw-3971541-gcc-invoice-arabic-product-name-etvi-gn6P-fw
head
0522a6fd522311cdb2530e5a559444272151aa1c
odoo/odoo
17.0 #169267
saas-17.1 #172065
saas-17.2 #172089
saas-17.3 #172179
saas-17.4 #172798
master #172180

[FW][FIX] l10n_gcc_invoice: force RTL Arabic partner

Current behavior:
Lines in an invoice may display a product name incorrectly if
they mix arabic/latin characters.

Expected behavior:
These types of product names should respect the RTL syntax if
being sent to an Arabic lang partner.

Steps to reproduce:
Ensure the rtlcss node package is installed and in PATH

  1. Create a Saudi company / switch to a demo one, switch to
    Arabic language

  2. Create a product with the name:
    دفتر سلكي بهوية الهيئة A4 - شد 50 ورقة

  3. Create an invoice to a partner with Arabic set as their lang

  4. Confirm the invoice -> print it

  5. The product name on the PDF has a mal-ordered name

Cause of the issue:
The right-to-left rule of the Arabic language is not getting
enforced.

There is a secondary bug where certain whitespace-delimited
substrings get displayed in a broken, overlapping way. From my
no-comprehensive testing, it seems to only happen when there is
a sequence in the string where you have some substring ending in
a numeral (0-9) followed by a single-space, then another
substring that begins with an Arabic alphabet character.

Fix:
When printing an invoice with an arabic partner:
1. Use right-aligned text instead of left

  1. Pad single-space breaks between substrings in a product name
    where the first substring ends with a numeral and the
    second begins with an alpha char.

  2. Add explicit dir="rtl" attribute to the display node

opw-3971541

Forward-Port-Of: #172179
Forward-Port-Of: #169267