콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
6684 화면

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

아바타
취소
작성자

¡Hola!  


Mi nuevo correo es: lzelaya@ioepik.legal


Visítanos en: IO · Epik y LinkedIn  


¡Saludos Cordiales!  


Lesly Zelaya 


베스트 답변

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)

아바타
취소
베스트 답변

Great. This worked

아바타
취소
작성자 베스트 답변

@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!!

아바타
취소
관련 게시물 답글 화면 활동
2
2월 23
6428
1
7월 22
2752
0
10월 20
4108
1
9월 20
6825
3
3월 15
8379