I have a field "n_total" which stores the total value.
I want to convert this float value into words as an INR (Indian Rupee) in another field "w_amount".
So I write a function to get the total amount in words.
My function is:
def _amount_in_words(self, cr, uid, ids, field_name, arg, context=None):
cur_obj = self.pool.get('res.currency')
res = {}
for words in self.browse(cr, uid, ids, context=context):
res[words.id] = amount_to_text_en.amount_to_text(float(words.n_total),cur_obj)
return res
The field is
'w_amount':fields.function(_amount_in_words, string='In Words', type="char", store=True, help="The amount in words"),
The field show in words but it is in Euro.
For example the words are shown like this
Five Thousand, One Hundred Ninety-Two euro and Thirty-One Cents
I want to show this is in INR
How can I achieve this?
My second doubt is I want to add the text Only at the end of the the words. How can I do this?
Thanks.