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
- Księgowość
- Zapasy
- PoS
- Projekt
- MRP
To pytanie dostało ostrzeżenie
1
Odpowiedz
3778
Widoki
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
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
|
3
lip 25
|
5133 | ||
|
|
3
cze 25
|
7512 | ||
|
|
5
maj 25
|
8094 | ||
|
|
2
maj 25
|
3934 | ||
|
|
1
sie 24
|
3510 |