from odoo.tools import amount_to_text_en
def set_amt_in_worlds(self):
amount, currency = self.amount_total, self.currency_id.name
amount_in_words = amount_to_text_en.amount_to_text(amount, lang='en', currency=currency)
if currency == 'INR':
amount_in_words = str(amount_in_words).replace('INR', 'rupees')
amount_in_words = str(amount_in_words).replace('Cents', 'paise')
amount_in_words = str(amount_in_words).replace('Cent', 'paise')
amount_in_words += '\tonly'
self.amt_in_words = amount_in_words.capitalize()
amt_in_words = fields.Char(compute='set_amt_in_worlds')