Odoo Help

0

Create database with code in Odoo

By
Sonia
on 4/18/16, 5:33 AM 467 views

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

The database contains only the modules chosen by the customer.

1

Yenthe

--Yenthe--
7242
| 7 7 8
Turnhout, Belgium
--Yenthe--

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

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

Yenthe
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

Yenthe

0
Sonia
On 4/18/16, 8:34 AM

Hi Yenthe

 Thank you so much

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

Yenthe
on 4/18/16, 9:17 AM

can you give me your email to contact you,please

Sonia
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.

Register

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)

Stats

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