Hii,
On sales invoice pdf report, I show amount in words, both English and Arabic. SAR is local currency.
Amount is translated except Currency Unit and Subunit for Arabic only. here is an example.
Two Thousand, Four Hundred And Thirty-Five Dollars and Forty Cents
ألفين، أربعة مئة و خمسة وثلاثين Dollars و أربعين Cents
Four Hundred And Seventy-Eight Riyal and Ninety-One Halala
أربعة مئة و ثمانية وسبعين Riyal و واحد وتسعين Halala- Dollar and Cents not translated in Arabic
- Riyal and Halala not Translated in Arabic
Here is my function that translate function
class TccAccountInvoice(models.Model): _inherit = 'account.invoice' def invoice_amount_in_words(self, lang, amount): return self.currency_id.with_context(lang=lang).amount_to_text(amount)
XML Call
<t t-esc="o.invoice_amount_in_words('en_US', o.amount_total)"/> <t t-esc="o.invoice_amount_in_words('ar_AA', o.amount_total)"/>
Where to add the translation for Currency Unit and Subunit for Arabic saudi.
Version: Odoo 12 EE