Skip to Content
Menu
This question has been flagged
3 Replies
6608 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
Feb 23
6288
1
Jul 22
2706
0
Oct 20
4002
1
Sep 20
6729
3
Mar 15
8265