Skip to Content
मेन्यू
This question has been flagged
3 Replies
6613 Views

I'm trying to get amount_to_text working on a Odoo's Cloud Hosted site, but every solution requires me to change/modify python code. Not sure if this is possible on the cloud hosted site or amount_to_text is available natively on QWeb editor. I just need to print the invoice total in letters.

Example:

Total: $240.00

Result: Two hundred and forty dollars

Avatar
Discard
Author

¡Hola!  


Mi nuevo correo es: lzelaya@ioepik.legal


Visítanos en: IO · Epik y LinkedIn  


¡Saludos Cordiales!  


Lesly Zelaya 


Best Answer

You cannot modify server side code on the hosted solution. However, you can add custom computed fields to a model which can be based on python code that is entered through the UI.

For example, if you want the Invoice Total in words, add a computed field called  x_amount_total_in_words to the account.move model like so. You can then use the computed field in QWeb like a normal field.



Python Code:

for record in self:
    record['x_amount_total_in_words'] = record.currency_id.amount_to_text(record.amount_total)

Avatar
Discard
Best Answer

Great. This worked

Avatar
Discard
Author Best Answer

@Paresh It works fantastically, thank you very much. I can't upvote or mark as answer (lack of karma). But will return in the future to upvote and mark as answer. Thanks!!

Avatar
Discard
Related Posts Replies Views Activity
2
फ़र॰ 23
6301
1
जुल॰ 22
2712
0
अक्तू॰ 20
4008
1
सित॰ 20
6735
3
मार्च 15
8270