[UPD] format and update license
This commit is contained in:
parent
f4dec8a73a
commit
c1b9a5fee4
50 changed files with 169 additions and 139 deletions
|
|
@ -1,29 +1,34 @@
|
|||
#!/usr/bin/env python
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 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
|
||||
from os import listdir
|
||||
from os.path import abspath, isdir, join
|
||||
|
||||
parser = argparse.ArgumentParser(prog='Configure base dir for all addons')
|
||||
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.")
|
||||
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))]
|
||||
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()
|
||||
|
|
@ -39,9 +44,9 @@ config.read(srcConfigPath)
|
|||
|
||||
separator = ","
|
||||
|
||||
config.set('options', 'addons_path', separator.join(addonsDirs))
|
||||
config.set("options", "addons_path", separator.join(addonsDirs))
|
||||
|
||||
print(config.get('options', 'addons_path'))
|
||||
print(config.get("options", "addons_path"))
|
||||
|
||||
with open(dstConfigPath, 'w') as configfile:
|
||||
with open(dstConfigPath, "w") as configfile:
|
||||
config.write(configfile)
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
import psycopg2
|
||||
import sys
|
||||
import time
|
||||
|
||||
if __name__ == '__main__':
|
||||
import psycopg2
|
||||
|
||||
if __name__ == "__main__":
|
||||
arg_parser = argparse.ArgumentParser()
|
||||
arg_parser.add_argument('--db_host', required=True)
|
||||
arg_parser.add_argument('--db_port', required=True)
|
||||
arg_parser.add_argument('--db_user', required=True)
|
||||
arg_parser.add_argument('--db_password', required=True)
|
||||
arg_parser.add_argument('--db_name', required=False, default="postgres")
|
||||
arg_parser.add_argument('--timeout', type=int, default=10)
|
||||
arg_parser.add_argument("--db_host", required=True)
|
||||
arg_parser.add_argument("--db_port", required=True)
|
||||
arg_parser.add_argument("--db_user", required=True)
|
||||
arg_parser.add_argument("--db_password", required=True)
|
||||
arg_parser.add_argument("--db_name", required=False, default="postgres")
|
||||
arg_parser.add_argument("--timeout", type=int, default=10)
|
||||
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
|
|
@ -22,12 +23,16 @@ if __name__ == '__main__':
|
|||
print("Try connection to postgres...")
|
||||
|
||||
connected = False
|
||||
error = ''
|
||||
error = ""
|
||||
while ((time.time() - start_time) < args.timeout) or connected is True:
|
||||
try:
|
||||
conn = psycopg2.connect(user=args.db_user, host=args.db_host,
|
||||
port=args.db_port, password=args.db_password,
|
||||
dbname=args.db_name)
|
||||
conn = psycopg2.connect(
|
||||
user=args.db_user,
|
||||
host=args.db_host,
|
||||
port=args.db_port,
|
||||
password=args.db_password,
|
||||
dbname=args.db_name,
|
||||
)
|
||||
break
|
||||
except psycopg2.OperationalError as e:
|
||||
error = e
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
@ -14,7 +14,6 @@ import uuid
|
|||
from git import Repo
|
||||
from git.exc import InvalidGitRepositoryError, NoSuchPathError
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
format=(
|
||||
"%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d]"
|
||||
|
|
@ -383,10 +382,7 @@ class ProjectManagement:
|
|||
os.system(cmd)
|
||||
|
||||
if not self.keep_bd_alive:
|
||||
cmd = (
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {bd_name_demo}"
|
||||
)
|
||||
cmd = "./odoo_bin.sh db --drop --database" f" {bd_name_demo}"
|
||||
_logger.info(cmd)
|
||||
os.system(cmd)
|
||||
|
||||
|
|
@ -467,10 +463,7 @@ class ProjectManagement:
|
|||
os.system(cmd)
|
||||
|
||||
if not self.keep_bd_alive:
|
||||
cmd = (
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {bd_name_template}"
|
||||
)
|
||||
cmd = "./odoo_bin.sh db --drop --database" f" {bd_name_template}"
|
||||
_logger.info(cmd)
|
||||
os.system(cmd)
|
||||
|
||||
|
|
@ -538,10 +531,7 @@ class ProjectManagement:
|
|||
os.system(cmd)
|
||||
|
||||
if not self.keep_bd_alive:
|
||||
cmd = (
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {bd_name_generator}"
|
||||
)
|
||||
cmd = "./odoo_bin.sh db --drop --database" f" {bd_name_generator}"
|
||||
_logger.info(cmd)
|
||||
os.system(cmd)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,40 +1,48 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
print("This script only work with localhost:8069, not working with remote instance.")
|
||||
print(
|
||||
"This script only work with localhost:8069, not working with remote instance."
|
||||
)
|
||||
|
||||
import requests
|
||||
import sys
|
||||
import logging
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ODOO_URL = '' # Your Odoo server URL
|
||||
DATABASE_NAME = ''
|
||||
MASTER_PASSWORD = ''
|
||||
import requests
|
||||
|
||||
ODOO_URL = "" # Your Odoo server URL
|
||||
DATABASE_NAME = ""
|
||||
MASTER_PASSWORD = ""
|
||||
# BACKUP_FORMAT = env('BACKUP_FORMAT', default='zip') # 'zip' or 'dump'
|
||||
BACKUP_FORMAT = 'zip' # 'zip' or 'dump'
|
||||
OUTPUT_FILE_NAME = f'{DATABASE_NAME}_backup.{BACKUP_FORMAT}'
|
||||
BACKUP_FORMAT = "zip" # 'zip' or 'dump'
|
||||
OUTPUT_FILE_NAME = f"{DATABASE_NAME}_backup.{BACKUP_FORMAT}"
|
||||
|
||||
# --- Logger Setup ---
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# TODO not working with remote, only localhost
|
||||
logger.error("This script is not working with remote instance, only http://127.0.0.1:8069")
|
||||
logger.error(
|
||||
"This script is not working with remote instance, only http://127.0.0.1:8069"
|
||||
)
|
||||
|
||||
|
||||
# --- Function to download the database ---
|
||||
def download_odoo_db():
|
||||
logger.info(f"Attempting to download database '{DATABASE_NAME}' from URL '{ODOO_URL}'...")
|
||||
logger.info(
|
||||
f"Attempting to download database '{DATABASE_NAME}' from URL '{ODOO_URL}'..."
|
||||
)
|
||||
|
||||
# URL for the backup endpoint
|
||||
backup_url = f'{ODOO_URL}/web/database/backup'
|
||||
backup_url = f"{ODOO_URL}/web/database/backup"
|
||||
|
||||
# Form data for the POST request
|
||||
payload = {
|
||||
'master_pwd': MASTER_PASSWORD,
|
||||
'name': DATABASE_NAME,
|
||||
'backup_format': BACKUP_FORMAT,
|
||||
"master_pwd": MASTER_PASSWORD,
|
||||
"name": DATABASE_NAME,
|
||||
"backup_format": BACKUP_FORMAT,
|
||||
}
|
||||
|
||||
try:
|
||||
|
|
@ -43,20 +51,28 @@ def download_odoo_db():
|
|||
response.raise_for_status() # Raise an exception for bad status codes
|
||||
|
||||
# --- VALIDATION ---
|
||||
content_type = response.headers.get('Content-Type', '').split(';')[0]
|
||||
content_type = response.headers.get("Content-Type", "").split(";")[0]
|
||||
|
||||
# Check if the content type is valid
|
||||
expected_types = ['application/zip', 'application/octet-stream']
|
||||
expected_types = ["application/zip", "application/octet-stream"]
|
||||
if content_type not in expected_types:
|
||||
logger.error(f"ERROR: Expected one of {expected_types} but got {content_type}.")
|
||||
logger.error("This usually indicates a server-side error or an incorrect master password.")
|
||||
logger.error(
|
||||
f"ERROR: Expected one of {expected_types} but got {content_type}."
|
||||
)
|
||||
logger.error(
|
||||
"This usually indicates a server-side error or an incorrect master password."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
# Check if the content is an HTML page (to handle incorrect passwords)
|
||||
first_chunk = next(response.iter_content(chunk_size=128), b'')
|
||||
if first_chunk.startswith(b'<'):
|
||||
logger.error("ERROR: It seems the server returned an HTML page instead of a database file.")
|
||||
logger.error("This is often due to an incorrect master password or an invalid request.")
|
||||
first_chunk = next(response.iter_content(chunk_size=128), b"")
|
||||
if first_chunk.startswith(b"<"):
|
||||
logger.error(
|
||||
"ERROR: It seems the server returned an HTML page instead of a database file."
|
||||
)
|
||||
logger.error(
|
||||
"This is often due to an incorrect master password or an invalid request."
|
||||
)
|
||||
logger.error("Server Response (First 200 chars):")
|
||||
logger.error(response.text[:200])
|
||||
sys.exit(1)
|
||||
|
|
@ -65,26 +81,35 @@ def download_odoo_db():
|
|||
logger.info(f"Download started, saving to '{OUTPUT_FILE_NAME}'...")
|
||||
|
||||
output_path = Path(OUTPUT_FILE_NAME)
|
||||
with open(output_path, 'wb') as f:
|
||||
with open(output_path, "wb") as f:
|
||||
# Write the content from the first chunk to the file
|
||||
f.write(first_chunk)
|
||||
# Continue writing the rest of the stream in chunks
|
||||
for chunk in response.iter_content(chunk_size=8192):
|
||||
f.write(chunk)
|
||||
|
||||
logger.info(f"Download successful! File saved at: {output_path.resolve()}")
|
||||
logger.info(
|
||||
f"Download successful! File saved at: {output_path.resolve()}"
|
||||
)
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error(f"An error occurred while connecting to the Odoo server: {e}")
|
||||
logger.error(
|
||||
f"An error occurred while connecting to the Odoo server: {e}"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"An unexpected error occurred: {e}")
|
||||
|
||||
|
||||
# --- Script execution ---
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
# Add a simple check to ensure the user has configured the variables
|
||||
if ODOO_URL == 'http://localhost:8069' and DATABASE_NAME == 'your_database_name':
|
||||
logger.error("Please configure the ODOO_URL, DATABASE_NAME, and MASTER_PASSWORD variables at the start of the script.")
|
||||
if (
|
||||
ODOO_URL == "http://localhost:8069"
|
||||
and DATABASE_NAME == "your_database_name"
|
||||
):
|
||||
logger.error(
|
||||
"Please configure the ODOO_URL, DATABASE_NAME, and MASTER_PASSWORD variables at the start of the script."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
download_odoo_db()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
from collections import defaultdict
|
||||
|
||||
|
|
@ -161,19 +161,19 @@ def delete_record(cr):
|
|||
cr.execute(query_search)
|
||||
|
||||
query_search = """
|
||||
DELETE FROM `tbl_commande_membre_produit`
|
||||
DELETE FROM `tbl_commande_membre_produit`
|
||||
WHERE NoFournisseurProduitCommande in (22659, 22724, 22662, 22663, 22732, 22670, 22705, 22737, 22741, 22679, 22680, 22682, 22655);
|
||||
"""
|
||||
cr.execute(query_search)
|
||||
|
||||
query_search = """
|
||||
DELETE FROM `tbl_echange_service`
|
||||
DELETE FROM `tbl_echange_service`
|
||||
WHERE NoMembreVendeur in (7703);
|
||||
"""
|
||||
cr.execute(query_search)
|
||||
|
||||
query_search = """
|
||||
DELETE FROM `tbl_categorie_sous_categorie`
|
||||
DELETE FROM `tbl_categorie_sous_categorie`
|
||||
WHERE NoCategorie in (999);
|
||||
"""
|
||||
cr.execute(query_search)
|
||||
|
|
@ -210,7 +210,7 @@ def migrate_record(cr):
|
|||
i = 0
|
||||
for sous_categorie_id in lst_sous_categorie:
|
||||
i += 1
|
||||
query_search = f"""UPDATE tbl_sous_categorie set NoSousCategorieId={i}
|
||||
query_search = f"""UPDATE tbl_sous_categorie set NoSousCategorieId={i}
|
||||
WHERE NoCategorie={sous_categorie_id[1]} and NoSousCategorie='{sous_categorie_id[0]}'
|
||||
"""
|
||||
cr.execute(query_search)
|
||||
|
|
@ -232,7 +232,7 @@ def migrate_record(cr):
|
|||
f"Get null from {categorie_sous_categorie_id[2]} and"
|
||||
f" {categorie_sous_categorie_id[1]}"
|
||||
)
|
||||
query_search = f"""UPDATE tbl_categorie_sous_categorie set NoSousCategorieId={id_sous_categorie}
|
||||
query_search = f"""UPDATE tbl_categorie_sous_categorie set NoSousCategorieId={id_sous_categorie}
|
||||
WHERE NoCategorieSousCategorie={categorie_sous_categorie_id[0]}
|
||||
"""
|
||||
cr.execute(query_search)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
@ -301,18 +301,13 @@ def main():
|
|||
all_temp_bd = []
|
||||
|
||||
# Step 0, drop and restore
|
||||
cmd_drop_db = (
|
||||
f"./odoo_bin.sh db --drop --database {bd_temp_name}"
|
||||
)
|
||||
cmd_drop_db = f"./odoo_bin.sh db --drop --database {bd_temp_name}"
|
||||
all_temp_bd.append(bd_temp_name)
|
||||
run_cmd(cmd_drop_db)
|
||||
if not base_image_name or base_image_name == image_name_to_generate:
|
||||
with_demo = dct_config_image.get("with_demo")
|
||||
# Create a new one
|
||||
cmd = (
|
||||
f"./odoo_bin.sh db --create --database"
|
||||
f" {bd_temp_name}"
|
||||
)
|
||||
cmd = f"./odoo_bin.sh db --create --database" f" {bd_temp_name}"
|
||||
if with_demo:
|
||||
cmd += " --demo"
|
||||
else:
|
||||
|
|
@ -352,9 +347,7 @@ def main():
|
|||
# Step 6, clean if ask
|
||||
if not config.keep_database:
|
||||
for db_name in all_temp_bd:
|
||||
cmd_drop_db = (
|
||||
f"./odoo_bin.sh db --drop --database {db_name}"
|
||||
)
|
||||
cmd_drop_db = f"./odoo_bin.sh db --drop --database {db_name}"
|
||||
run_cmd(cmd_drop_db)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import requests
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
@ -7,7 +7,6 @@ import logging
|
|||
import os
|
||||
import sys
|
||||
|
||||
|
||||
new_path = os.path.normpath(
|
||||
os.path.join(os.path.dirname(__file__), "..", "..")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
@ -24,7 +24,9 @@ DEFAULT_PATH_MANIFEST_ODOO_CONF = os.path.join("conf", "git_manifest_odoo.csv")
|
|||
DEFAULT_PATH_MANIFEST_PRIVATE_CONF = os.path.join(
|
||||
"private", "default_git_manifest.csv"
|
||||
)
|
||||
DEFAULT_PATH_INSTALLED_ODOO_VERSION = os.path.join(".repo", "installed_odoo_version.txt")
|
||||
DEFAULT_PATH_INSTALLED_ODOO_VERSION = os.path.join(
|
||||
".repo", "installed_odoo_version.txt"
|
||||
)
|
||||
|
||||
|
||||
def get_config():
|
||||
|
|
@ -44,7 +46,11 @@ def get_config():
|
|||
"--input",
|
||||
help="First manifest to merge into input2. Second manifest, overwrite by input1.",
|
||||
)
|
||||
parser.add_argument("--output", default=".repo/local_manifests/erplibre_manifest.xml", help="Output of new manifest")
|
||||
parser.add_argument(
|
||||
"--output",
|
||||
default=".repo/local_manifests/erplibre_manifest.xml",
|
||||
help="Output of new manifest",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--att_revision_only",
|
||||
action="store_true",
|
||||
|
|
@ -89,11 +95,14 @@ def main():
|
|||
|
||||
if os.path.exists(DEFAULT_PATH_INSTALLED_ODOO_VERSION):
|
||||
with open(DEFAULT_PATH_INSTALLED_ODOO_VERSION, "r") as f:
|
||||
lst_installed_odoo_version = [a.strip() for a in f.readlines()]
|
||||
lst_installed_odoo_version = [
|
||||
a.strip() for a in f.readlines()
|
||||
]
|
||||
if lst_installed_odoo_version:
|
||||
for installed_odoo_version in lst_installed_odoo_version:
|
||||
path_manifest_odoo_version = os.path.join(
|
||||
"manifest", f"git_manifest_{installed_odoo_version}.xml"
|
||||
"manifest",
|
||||
f"git_manifest_{installed_odoo_version}.xml",
|
||||
)
|
||||
if os.path.exists(path_manifest_odoo_version):
|
||||
lst_input.append(path_manifest_odoo_version)
|
||||
|
|
@ -102,7 +111,8 @@ def main():
|
|||
f"ERROR: {path_manifest_odoo_version} does not exist"
|
||||
)
|
||||
path_manifest_odoo_version = os.path.join(
|
||||
"manifest", f"git_manifest_{installed_odoo_version}_dev.xml"
|
||||
"manifest",
|
||||
f"git_manifest_{installed_odoo_version}_dev.xml",
|
||||
)
|
||||
if os.path.exists(path_manifest_odoo_version):
|
||||
lst_input.append(path_manifest_odoo_version)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import asyncio
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import json
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import datetime
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
@ -97,7 +97,10 @@ def main():
|
|||
# Default paths and fallback values (same logic as in the bash script)
|
||||
el_user = args.user
|
||||
el_home_erplibre = args.home_erplibre or os.getcwd()
|
||||
el_config_name = args.config_name or f"erplibre_{el_user}_{os.path.basename(os.getcwd())}"
|
||||
el_config_name = (
|
||||
args.config_name
|
||||
or f"erplibre_{el_user}_{os.path.basename(os.getcwd())}"
|
||||
)
|
||||
exec_param = (
|
||||
" "
|
||||
+ f" {w_cmd("-d", args.database or "")} {w_cmd("-p", args.port or "")}".strip()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||
# © 2021-2025 TechnoLibre (http://www.technolibre.ca)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
|
||||
# This script need only basic importation, it needs to be supported by python of your system
|
||||
|
|
|
|||
Loading…
Reference in a new issue