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.


Create database with code in Odoo

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

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

The database contains only the modules chosen by the customer.



| 7 7 8
Turnhout, Belgium

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

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

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: 4/18/16, 5:33 AM
Seen: 248 times
Last updated: 4/18/16, 9:01 AM