From 2646308dfb389a55d928c4b2fc7331b6c5ac596d Mon Sep 17 00:00:00 2001 From: Mauro Rosero P Date: Sun, 1 Dec 2024 22:31:17 -0500 Subject: [PATCH] [MODIFIED] Se crea odoo.conf desde plantilla y se inicializa odoo,log - Se crea odoo.conf desde odoo.base.conf - Se inicializa odoo.log --- bin/lib/odoo.lib | 38 ++++++++++++++++++++++++++++++++++++++ bin/msg/odoo.es | 4 +++- bin/project.sh | 8 +++++++- config/odoo.base.conf | 21 +++++++++++++++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 config/odoo.base.conf diff --git a/bin/lib/odoo.lib b/bin/lib/odoo.lib index e2b357f..99ff60f 100644 --- a/bin/lib/odoo.lib +++ b/bin/lib/odoo.lib @@ -28,6 +28,11 @@ ODOO_APP=apps ODOO_DOC=docs ODOO_ETC=etc ODOO_CFG=config +ODOO_SET=odoo.conf +ODOO_LOG=odoo.log + +ODOO_CFG_BASE=odoo.base.conf +ODOO_CFG_SAAS=odoo.saas.conf # Test odoo library function odoolib_test() { @@ -72,3 +77,36 @@ function copy_dockerfile() { fi fi } + +# Copy odoo config template file to etc +function copy_odooconfig() { + + local ODOO_PATH=$1 + local ODOO_PROJ=$2 + local ODOOFILE=$3 + + if [ ! -f "$ODOO_PATH/$ODOO_PROJ/$ODOO_ETC/$ODOO_SET" ] + then + cp $ODOOFILE "$ODOO_PATH/$ODOO_PROJ/$ODOO_ETC/$ODOO_SET" + if [ $? -eq 0 ] + then + echo "[x] $odmsg_010 $ODOOFILE" + fi + fi +} + +# Create new odoo log file +function create_odoolog() { + + local ODOO_PATH=$1 + local ODOO_PROJ=$2 + + if [ ! -f "$ODOO_PATH/$ODOO_PROJ/$ODOO_ETC/$ODOO_LOG" ] + then + echo > "$ODOO_PATH/$ODOO_PROJ/$ODOO_ETC/$ODOO_LOG" + if [ $? -eq 0 ] + then + echo "[x] $odmsg_011" + fi + fi +} diff --git a/bin/msg/odoo.es b/bin/msg/odoo.es index 4c31c78..41641ac 100644 --- a/bin/msg/odoo.es +++ b/bin/msg/odoo.es @@ -12,7 +12,7 @@ #============================================================================== odmsg_000="(ODOO TOOLS)" -odmsg_001="- PROYECTO NUEVO" +odmsg_001="- INICIALIZACIÓN" odmsg_002="Ambiente de desarrollo Odoo no instalado!" odmsg_003_1="Uso:" odmsg_003_2=" [--help] [--version]" @@ -23,3 +23,5 @@ odmsg_007=" --version Muestra la versión del script." odmsg_008_1="Estructura de carpetas de proyecto" odmsg_008_2="fue creada!" odmsg_009="Dockerfile fue creado!" +odmsg_010="odoo.conf creado desde" +odmsg_011="Archivo de auditoria odoo (odoo.log) fue inicializado!" diff --git a/bin/project.sh b/bin/project.sh index fc00008..8d5da76 100755 --- a/bin/project.sh +++ b/bin/project.sh @@ -76,5 +76,11 @@ fi # Create odoo project path odoo_structure $BIN_HOME "$1" -# Copy Dockerfile to build (local) +# Copy dockerfile template file to build (local) copy_dockerfile $BIN_HOME "$1" "$BIN_HOME/$ODOO_CFG/$DOCKER_LOCAL" + +# Copy odoo config template file to etc (base) +copy_odooconfig $BIN_HOME "$1" "$BIN_HOME/$ODOO_CFG/$ODOO_CFG_BASE" + +# Create odoo.log on etc +create_odoolog $BIN_HOME "$1" diff --git a/config/odoo.base.conf b/config/odoo.base.conf new file mode 100644 index 0000000..4c7187e --- /dev/null +++ b/config/odoo.base.conf @@ -0,0 +1,21 @@ +[options] +addons_path = /mnt/extra-addons/base +data_dir = /data +http_enable = True +http_port = 8069 +proxy_mode = False +reportgz = False +translate_modules = ['all'] +i18n_install_languages = es_ES +language = es_ES,en_US,es_PA +logfile = /etc/odoo/odoo.log +dev_mode = reload +max_cron_threads = 1 +geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb +limit_memory_soft = 629145600 +limit_memory_hard = 1677721600 +limit_time_cpu = 600 +limit_time_real = 3000000 +limit_request = 8192 +admin_passwd = dbcr_6409 +server_wide_modules = base,web