Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How can I have the total of a check written out?

Nate Foster
on 8/20/14, 6:09 PM 843 views

When I generate a check in OpenERP 7, it does not include the 'written' total of the check.  I need our checks to include both a numeric total (ie $50) as well as a written total (ie Fifty Dollars US). 

Thanks for the help! 



This is a functional requirement IMO

Kyle Krenzer
on 8/20/14, 8:13 PM
Nate Foster
On 9/11/14, 2:53 PM

Not sure what fixed this, but it is now resolved for me.  I did add numpy and num2words to my python modules for another project.  Not sure if this was what fixed it or not. 



| 5 3 6
Jakarta, Indonesia
On 9/13/14, 2:48 PM

Nate, though you have indicated that you have solved your problem, allow me just to note that OpenERP does have amount_to_text function for English language (as well as for French and Dutch).  However the amount_to_text for English language is not turned 'on' by default (don't ask me why).  Anyway, to use what OpenERP had provided you need to add the amount_to_text for English language.  Create a new .py file in your module with the following content:

from openerp.tools.amount_to_text_en import english_number

from openerp.tools.amount_to_text import add_amount_to_text_function

def amount_to_text_en(number, currency):
    number = '%.2f' % number
    units_name = currency
    list = str(number).split('.')
    start_word = english_number(int(list[0]))
    end_word = english_number(int(list[1]))
    cents_number = int(list[1])
    cents_name = (cents_number > 1) and 'Cents' or 'Cent'

    return ' '.join(filter(None, [start_word, units_name, (start_word or units_name) and (end_word or cents_name) and 'and', end_word, cents_name]))

add_amount_to_text_function('en', amount_to_text_en)

Note that the amount_to_text_en is an exact copy of one of the amount_to_text method in openerp.tools.amount_to_text_en, which due to the fact that there are 2 amount_to_text methods in that file python will take the last amount_to_text method, which is NOT what we want.

After which you can use it in your report parser by just adding from openerp.tools.amount_to_text import amount_to_text

Alex Gallien
On 8/20/14, 6:13 PM

You could try implementing this: http://sourceforge.net/projects/pynum2word/

Then have whatever functon calculates the check total also convert it to text and store it in a new field. I haven't explored the check writing features in OpenERP, so maybe someone else could help you further.

Thanks Alex. I'll check it out. Am I the only one who thinks it is odd that this would have been left out? Seems like this would be a required feature for checks drawn on US banks.

Nate Foster
on 8/20/14, 6:23 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 8/20/14, 6:09 PM
Seen: 843 times
Last updated: 3/16/15, 8:10 AM