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 do I add (or import) a Python module into OpenERP 7?

Nate Foster
on 9/5/14, 5:27 PM 2,568 views

I wish to add the num2words module to OpenERP as the built in facility to convert numbers to text (ie 42 is Forty Two) is not working for me. 

ThackerS (ts)
On 9/5/14, 6:53 PM

Hi Foster.
When you develop your own module, there are two ways to import it into openerp.

  • First way (Best practice):

You create another folder (i.e..: my_own_addons) in openerp and you put it your own module, after that, you put the path of this folder on the addons_path in the openerp-server.conf file

  • Second way (Not recommended):

you put your own module directly into openerp addons folder.

In the two ways, after putting your own module, you restart your openerp server, you log into your openerp and you go to settings, you click into to upgrade the list of openerp module, you type the name of your module in the search bar, you install it.
Best regards.



| 5 3 6
Jakarta, Indonesia
On 9/8/14, 6:50 AM

Foster,  OpenERP had the feature that you are looking for available in server/openerp/tools/amount_to_text_en.py.  To use it, you just need to add the following line among the imports: from openerp.tools.amount_to_text_en import amount_to_text.  Then you can use it after that declaration: string_to_print = amount_to_text(number_to_convert).  If you want to use it in reports, that's a different story.  Let me know if that's your purpose.

There is also english_number method in case you don't want to use the currency part.

Back to your question, in general there are 2 recommended ways to include a python module into Odoo.

First is to include it into any path that is in your operating system's PYTHONPATH (https://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH) and use it by way of import.  This is if you want your module to be used by other Python program as well.

Second is to include it in the module that you build.  This is usually easier if you use it only for a one particular module.  You can use it in other modules as well, but do make sure that the dependency is properly set.


Thanks John Doe. :-)

Nate Foster
on 9/11/14, 5:40 PM


| 5 4 7
Bikaner, India

OpenERP Devloper at SunARC Technology

On 9/8/14, 5:21 AM

Python Module to add in Openrp Server Folder.

For Example in version 7

 Openenerp installed server path to add Python num2words Module.

 C:\Program Files\OpenERP 7.0--\Server\server

Openerp Installed addons path create custom module and Import python module

C:\Program Files\OpenERP 7.0---\Server\server\openerp\addons\cust_module

import num2words



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

1 follower(s)


Asked: 9/5/14, 5:27 PM
Seen: 2568 times
Last updated: 3/16/15, 8:10 AM