Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
6923 Visualizzazioni

how to convert amount to letters in indian format in invoice report??? can somebody help me

Avatar
Abbandona

What do you mean by indian format ?

Risposta migliore

#Improt this funciton in your py file

from openerp.tools.amount_to_text_en import amount_to_text
amt = 13456
amount_in_word = amount_to_text(amt)

print "Amount in word ::::::::::",amount_in_word

Hope this will help you.

Regards, Anil

Avatar
Abbandona
Risposta migliore

in your python file import the following line

from openerp.tools import amount_to_text_en

Then create a function convert in your class in the file

def convert(self, amount, cur):
    amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
    return amt_en

Here arguents are amount(float), language and currency. If you want to change the format again, then you can use any of the string operations like replace to replace the string we get from the amount_to_text() function

Avatar
Abbandona