- oficially support odoo 18 instead of odoo 16 - support postgis/postgresql 18 into docker - change version erplibre 1.6.0 - support private environment and support local git repo manifest - support switch odoo version - support docker for each version - update os installation - upgrade python requirement - separate virtual environment for erplibre and odoo
47 lines
1.5 KiB
Python
Executable file
47 lines
1.5 KiB
Python
Executable file
#!/usr/bin/env python
|
|
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
|
|
|
import argparse
|
|
|
|
from os import listdir
|
|
from os.path import isdir, join, abspath
|
|
|
|
import configparser
|
|
|
|
parser = argparse.ArgumentParser(prog='Configure base dir for all addons')
|
|
|
|
parser.add_argument("addonsBaseDir", help="Path where addons are cloned.")
|
|
parser.add_argument("srcConfigPath",
|
|
help="Path where we retrieve source config file to adapt with new "
|
|
"addons path.")
|
|
parser.add_argument("dstConfigPath", help="Path to save adapted configuration.")
|
|
|
|
args = parser.parse_args()
|
|
addonsBaseDir = args.addonsBaseDir
|
|
srcConfigPath = args.srcConfigPath
|
|
dstConfigPath = args.dstConfigPath
|
|
|
|
addonsDirs = [abspath(join(addonsBaseDir, f)) for f in listdir(addonsBaseDir) if
|
|
isdir(join(addonsBaseDir, f))]
|
|
|
|
with open(".odoo-version", "r") as f:
|
|
odoo_version = f.readline().strip()
|
|
str_odoo_version = f"odoo{odoo_version}"
|
|
|
|
# addonsDirs.insert(0, "/usr/lib/python3/dist-packages/odoo/addons/")
|
|
addonsDirs.insert(0, f"/ERPLibre/{str_odoo_version}/addons/addons")
|
|
addonsDirs.insert(0, f"/ERPLibre/{str_odoo_version}/odoo/addons")
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
config.read(srcConfigPath)
|
|
|
|
separator = ","
|
|
|
|
config.set('options', 'addons_path', separator.join(addonsDirs))
|
|
|
|
print(config.get('options', 'addons_path'))
|
|
|
|
with open(dstConfigPath, 'w') as configfile:
|
|
config.write(configfile)
|