diff --git a/.gitmodules b/.gitmodules index b062fe87..19adda9d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -82,10 +82,6 @@ path = oca/sale-workflow url = git@github.com:OCA/sale-workflow.git branch = 16.0 -[submodule "oca/dms"] - path = oca/dms - url = git@github.com:OCA/dms.git - branch = 16.0 [submodule "oca/social"] path = oca/social url = git@github.com:OCA/social.git @@ -226,11 +222,11 @@ path = oca/sale-reporting url = https://github.com/OCA/sale-reporting.git branch = 16.0 -[submodule "oca/survey"] - path = oca/survey - url = git@github.com:OCA/survey.git - branch = 16.0 [submodule "oca/account-reconcile"] path = oca/account-reconcile url = git@github.com:OCA/account-reconcile.git branch = 16.0 +[submodule "oca/survey"] + path = oca/survey + url = git@github.com:OCA/survey.git + branch = 16.0 diff --git a/README.md b/README.md index c44f2a23..c1a77fbe 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,14 @@ Scaffold a new module. task create-module addons/project_report ``` +**Add custom module path** + +Update the `.env` file with the module path. + +```bash +ODOO_ADDONS_PATH=,addons/survey +``` + ### Docker Run Odoo with Docker container. diff --git a/addons/website b/addons/website index 8b7f3dcd..15bd68c6 160000 --- a/addons/website +++ b/addons/website @@ -1 +1 @@ -Subproject commit 8b7f3dcd300ff406bb9564cca0b29d3fcf4eab17 +Subproject commit 15bd68c6f29f7deac4e6eb4a59a37579818dad92 diff --git a/config/odoo-native.conf b/config/odoo-native.conf index d022c038..bf8ee383 100644 --- a/config/odoo-native.conf +++ b/config/odoo-native.conf @@ -1,5 +1,4 @@ [options] -addons_path = odoo/addons,enterprise,themes,odoo,oca/partner-contact,addons/server_tools,addons/project,oca/project,oca/web,oca/timesheet,oca/crm,oca/knowledge,oca/server-auth,oca/server-backend,oca/server-ux,oca/brand,oca/hr,oca/website,oca/reporting-engine,oca/server-tools,oca/product-attribute,oca/sale-workflow,oca/dms,oca/social,oca/bank-statement-import,oca/rest-framework,oca/contract,oca/purchase-workflow,oca/stock-logistics-warehouse,oca/account-invoicing,oca/server-env,oca/business-requirement,oca/connector,oca/edi,oca/community-data-files,oca/account-financial-reporting,oca/iot,oca/manufacture,oca/account-closing,oca/account-financial-tools,oca/bank-payment,addons/odoo_apps_partner,addons/sale_workflow,oca/credit-control,addons/hr,addons/manufacture,addons/stock_logistics_workflow,addons/swiss_payroll,oca/stock-logistics-workflow,addons/website,addons/product_attribute,addons/partner_contact,addons/vertical_saas,addons/social,addons/vertical_job_portal,oca/management-system,oca/hr-holidays,oca/sale-reporting,oca/survey,oca/account-reconcile admin_passwd = $pbkdf2-sha512$25000$v7dWau29F0LIee/9n/M.pw$uB2sLuvV7I.QlnLCYlR1enNps2D.chZbzavM2g/MAsMXgfkx/AC2X8sTejf4zfe21yOSPOpmdhWTgQSoYqGAPA limit_time_real = 600 db_host = localhost diff --git a/enterprise b/enterprise index 14c03d3e..807666b0 160000 --- a/enterprise +++ b/enterprise @@ -1 +1 @@ -Subproject commit 14c03d3e710786e1f138546b57ab0874d161917f +Subproject commit 807666b0e62e96d97e48a7739d7315ffda9a50bc diff --git a/oca/dms b/oca/dms deleted file mode 160000 index c4a707a5..00000000 --- a/oca/dms +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c4a707a565b783a841d61fb11a9988a5acde1691 diff --git a/oca/survey b/oca/survey index a62aa822..4bfbf839 160000 --- a/oca/survey +++ b/oca/survey @@ -1 +1 @@ -Subproject commit a62aa82284f266bd3127d2155e17db4a5992bca5 +Subproject commit 4bfbf839b78357827d31c4276f2cbbebf311f617 diff --git a/odoo b/odoo index 1ef67b67..5fee3538 160000 --- a/odoo +++ b/odoo @@ -1 +1 @@ -Subproject commit 1ef67b6734a14c97ef85d757f27cfc8946983f48 +Subproject commit 5fee3538adb8705378cffc84311143c06e88e053 diff --git a/task b/task index c394cb22..14c35f0b 100755 --- a/task +++ b/task @@ -27,6 +27,28 @@ if [[ -a ".env" ]]; then export $(cat .env | sed 's/#.*//g' | xargs) fi +function set-addons-path() { + # Read addons path list + ADDONS_PATH="$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | tr '\n' ',' | sed 's/,*$//g')" + + # Append env var + ADDONS_PATH="${ADDONS_PATH}${ODOO_ADDONS_PATH}" + + # Check if dir exists + for ADDON in $ADDONS_PATH; do + if [ -d "$ADDON" ]; then + echo "Path does not exist: $ADDON" + exit 1 + fi + done + + # Convert to docker paths + DOCKER_ADDONS_PATH="$(echo "$ADDONS_PATH" | sed 's|,|,/mnt/|g' | sed 's|,/mnt/odoo||g')" + + # Replace odoo path + ADDONS_PATH="$(echo "$ADDONS_PATH" | sed 's|,odoo,|,odoo/addons,|g')" +} + function update-readme() { if test -z "$1"; then echo "\$1 is empty."; exit; fi FILE_NAME=$(basename "$1") @@ -169,13 +191,11 @@ function open-url-with-delay(){ xdg-open $1 } -# function share-filestore(){ -# sudo chmod o+rwx -R ~/.local/share/Odoo/filestore -# } - function start() { - DATABASE=$2 + set-addons-path + # Use default database if second param is not given + DATABASE=$2 if test -z "$2"; then DATABASE="$GIT_BRANCH" fi @@ -216,8 +236,9 @@ function start() { locale activate-venv echo "Open http://localhost:8069 url in your browser." + echo $ADDONS_PATH open-url-with-delay "http://localhost:8069/web?db=$DATABASE" & - odoo-bin --config 'config/odoo-native.conf' --dev=all --log-handler odoo.tools.convert:DEBUG + odoo-bin --config 'config/odoo-native.conf' --addons-path="$ADDONS_PATH" --dev=all --log-handler odoo.tools.convert:DEBUG fi if [[ "$1" =~ "mail" ]]; then @@ -278,7 +299,7 @@ function init-db() { locale activate-venv - # share-filestore + echo "Make sure only one odoo process is running when initalizing the database." odoo-bin --init base -d $DATABASE --config 'config/odoo-native.conf' --stop-after-init --no-http --load-language $ODOO_LANGUAGE } @@ -300,13 +321,6 @@ function lint-module() { find $1 -type d -exec chmod u=rwx,go=rx {} \; find $1 -type f -exec chmod u=rw,go=r {} \; - # echo "Copy default configuration files" - # cp template/{.flake8,.gitignore,.isort.cfg,.pre-commit-config.yaml,.pylintrc} $1/../ - - # echo "Run pylint in $1" - # cd $1 - # pylint --load-plugins=pylint_odoo -d all -e odoolint $1 --valid-odoo-versions=$GIT_BRANCH - echo "Run pre-commit in $1" cd $1 pre-commit run --files ./* @@ -320,7 +334,6 @@ function lint-module() { function update-module() { if test -z "$1"; then echo "\$1 is empty."; exit; fi - # if test -z "$2"; then echo "\$2 is empty."; exit; fi DATABASE=$1 MODULE_NAME=$(basename $2) @@ -339,7 +352,6 @@ function update-module() { function generate-module-translation() { if test -z "$1"; then echo "\$1 is empty."; exit; fi - # if test -z "$2"; then echo "\$2 is empty."; exit; fi DATABASE=$1 MODULE_PATH=$2 @@ -838,21 +850,13 @@ function remove-submodule() { function update-config() { - # Read addons path list - ADDONS="$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | tr '\n' ',' | sed 's/,*$//g')" + set-addons-path - # Check if dir exists - for ADDON in $ADDONS; do - if [ -d "$ADDON" ]; then - echo "Path does not exist: $ADDON" - exit 1 - fi - done # Update native config - sed -i'' -e "s|addons_path.*|addons_path = odoo/addons,$ADDONS|g" "./config/odoo-native.conf" - ADDONS="$(echo "$ADDONS" | sed 's|,|,/mnt/|g' | sed 's|,/mnt/odoo||g')" + sed -i'' -e "s|addons_path.*|addons_path = $ADDONS_PATH|g" "./config/odoo-native.conf" + # Update docker config - sed -i'' -e "s|addons_path.*|addons_path = /mnt/$ADDONS|g" "./config/odoo.conf" + sed -i'' -e "s|addons_path.*|addons_path = /mnt/$DOCKER_ADDONS_PATH|g" "./config/odoo.conf" echo "Config updated." }