Tuesday, October 18, 2022

amount in words in odoo 14

 


In this blog we will crate function to convert number amount to words in Odoo 14 

so the input of this function will be (amount as numbers, language code), and the output will be the amount as words , now let us create the function with the name amount_as_text()

def amount_as_text(self,amount,lang):
        text = _(str(self.currency_id.with_context(lang=lang).amount_to_text(amount)))
        return text

 

We can call the function in report templates with Arabic language as bellow

<t t-set="amount_text" t-value="o.amount_as_text(o.amount_total,'ar_001')"/>

No comments:

Post a Comment

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...