コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
6447 ビュー

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

The database contains only the modules chosen by the customer.

アバター
破棄
最善の回答

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

アバター
破棄

Hi yenthe, I am looking for something like that.
In a nutshell, generating instances of odoo for customers based on sub domain with some installed modules.

Is this still up-to-date/ best solution ?
Thanks

Hi Yenthe, is there any way to do it for Odoo 16 ? I would appreciate your help. Thank you!

著作者 最善の回答

Hi Yenthe

 Thank you so much

アバター
破棄

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

著作者

can you give me your email to contact you,please