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