Odoo Help


Create database with code in Odoo

on 4/18/16, 5:33 AM 600 views

how to create database for a client with code (not with interface) ?

The database contains only the modules chosen by the customer.

On 4/18/16, 7:14 AM

Hi Sonia,

This is exactly what ERPpeek is made for (an external Python library). With ERPpeek you could do this in just a few lines of code. For example:

import erppeek DATABASE = 'ErpPeekDemoDatabase' SERVER = 'http://localhost:8080' ADMIN_PASSWORD = 'admin' client = erppeek.Client(server=SERVER) if not DATABASE in client.db.list(): print("The database does not exist yet, creating one!") client.create_database(ADMIN_PASSWORD, DATABASE) else: print("The database " + DATABASE + " already exists."

You can also install modules with ERPpeek:

client = erppeek.Client('http://localhost:8080', 'ErpPeekDemoDatabase', 'admin', 'admin') modules = client.modules('sale', installed=False) if 'sale' in modules['uninstalled']: client.install('sale')

Another way you could do this is by custom development through Python but ERPpeek works fine here and you could already use all the functions that are made, which are very powerful.
I've made some example scripts which you can find here: https://github.com/Yenthe666/Odoo_Samples/tree/master/ErpPeekDemo


On 4/18/16, 8:34 AM

Hi Yenthe

 Thank you so much

No problem! If it helped you please upvote / accept the answer. :)

on 4/18/16, 9:17 AM

can you give me your email to contact you,please

on 4/18/16, 9:56 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 4/18/16, 5:33 AM
Seen: 600 times
Last updated: 4/18/16, 9:01 AM