Hello Forum - We are trying to create a Odoo Full stack deployments with Docker-compose and Github actions on a VPS . We are stuck in automating module installs as we are adding many modules in the addons folder and are able to auto install only a few modules via the -i cli parm. This is getting complex when some modules are not getting installed. This scenario is while we create a new stack. We also need to auto install in future without taking down PG or by restarting. Is it due to their dependencies or anything that we are missing? If it is the dependencies then it might be a tedious job for 1 to figure out what modules use what. Please help us find an appropriate solution.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
3754
Tampilan
Hi S V,
Try using the json_rpc method to install the modules using its inbuild functions.
import json
import random
import urllib.request
import erppeek
TEST_SERVER = 'http://localhost:8069'
ADMIN_PASSWORD = 'odoo'
def json_rpc(url, method, params):
data = {
"jsonrpc": "2.0",
"method": method,
"params": params,
"id": random.randint(0, 1000000000),
}
req = urllib.request.Request(url=url, data=json.dumps(data).encode(), headers={
"Content-Type": "application/json",
})
reply = json.loads(urllib.request.urlopen(req).read().decode('UTF-8'))
if reply.get("error"):
raise Exception(reply["error"])
return reply["result"]
def call(url, service, method, *args):
return json_rpc(url, "call", {"service": service, "method": method, "args": args})
test_client = erppeek.Client(server=TEST_SERVER)
_logger.info("Creating database: %s" % database_name)
test_client.create_database(ADMIN_PASSWORD, database_name)
db_client = erppeek.Client(TEST_SERVER, database_name, 'admin', 'admin')
installed_modules = db_client.modules(installed=True)
for module in main_module_list: #main_module_list is the list containing the modules to be installed
if module not in installed_modules:
_logger.info("Installing module: %s" % module)
db_client.install(module)
Regards
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
|
3
Jul 25
|
5042 | ||
|
|
3
Jun 25
|
7457 | ||
|
|
5
Mei 25
|
8030 | ||
|
|
2
Mei 25
|
3883 | ||
|
|
1
Agu 24
|
3493 |