diff --git a/requirements.txt b/requirements.txt index 6c7bd5f6..187647d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,6 @@ docutils rst2html5 odoorpc coverage -pylint-odoo \ No newline at end of file +pylint-odoo +pytest==7.4.4 +pytest-odoo \ No newline at end of file diff --git a/task b/task index 9cc8c3d9..766af236 100755 --- a/task +++ b/task @@ -1,14 +1,110 @@ #!/bin/bash cd "$(dirname "$0")" || exit +function help-table() { + # Define column widths + cmd_width=25 + opt_width=20 + desc_width=90 + + # Print table header + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "Command" "Option" "Description" + echo "|$(printf '%*s' $((cmd_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((opt_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((desc_width + 2)) '' | tr ' ' '-')|" + + # Print table rows + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "build" "[path]" "Build Odoo Docker image. Optionally pass specific Dockerfile." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "change-uuid" "[env]" "Change database uuid via xmlrpc." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "checkout" "[branch][branch]" "Switch and merge from one branch to another." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "checkout-config-files" "[branch]" "Checkout config files from another branch." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "checkout-revision" "[revision]" "Run Odoo revision script or checkout revision set by env var." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "clear-assets" "[db]" "Clear all assets of Odoo database." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "clear-filestore" "[db]" "Clear local filestore folder. No param will clear all filestores. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "convert-database" "[db]" "Convert database backup file from PostgreSQL 9.5 to latest. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "create-module" "[path]" "Create new Odoo module from template." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "deploy" "[name]" "Deploy to Kubernetes cluster. Options: db, admin, odoo, mail." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "disable-auto-install" "" "Disable auto install for enterprise modules." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "disable-mailserver" "[env]" "Disable mail server settings via xmlrpc." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "docker-login" "" "Setup Docker Hub login credentials." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "drop-db" "[db]" "Drop target Odoo database. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "edit-env" "[env]" "Open env file in default editor." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "generate-admin-passwd" "[pass]" "Generate hash for Odoo master password." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "translate-module" "[env][path][lang]" "Generate translation for Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "generate-help-doc" "" "Write help table to task.md file." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "generate-module-security" "[path][model]" "Generate model access file for a selected model of a module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "get-module-version" "[path]" "Get module version from manifest." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-feature-branch" "[path]" "Create feature branch for Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-mig-branch" "[path]" "Create migration branch for Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-add" "[url] [path]" "Add git submodule." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-checkout" "" "Update submodules listed in the .gitmodules file." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-list" "" "List path and url of submodules." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-init" "" "Init submodules listed in the .gitmodules file." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-pull" "" "Pull all submodules." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-remove" "[path]" "Remove git submodule." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "git-submodule-switch" "[branch]" "Switch branch for all submodules." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "import-csv" "[db][path]" "Import data from csv. Filename must match PostgreSQL table name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "info" "" "Show values of project env vars." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "init-db" "[db]" "Initialize the Odoo database. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "init-nextcloud-env" "[env]" "Create env file for Nextcloud instance." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "init-odoo-env" "[env]" "Create env file for Odoo Instance." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "init-venv" "" "Initialize python virtual env." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "init-module" "[db][name,path]" "Initialize Odoo module. Default database is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "load-language" "[db][lang]" "Install language package in Odoo db." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "install-native" "" "Install Odoo requirements in source folder." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "install-odoo-scripts" "" "Install Odoo scripts." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "install-requirements" "[db][path]" "Install python packages from requirements.txt." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "install-snippet" "[env][path]" "Install snippet xml definition." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "down" "[name]" "Remove docker containers and volumes. Options: none, db, admin, odoo, mail." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "lint-module" "[path]" "Run pylint odoo for module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "lint-snippets" "" "Run checks for all snippets." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "list" "" "List Docker containers." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "list-addons" "" "List Odoo addons." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "list-env" "" "List env files." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "logs" "" "Tail Odoo Docker container logs." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "node-install" "" "Install build dependencies." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "node-dev" "" "Start vuepress development server." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "node-build" "" "Create vuepress build." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "node-serve-build" "" "Serve vuepress build." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "odoo-cloc" "[db]" "Count custom line of codes. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "patch-database" "[db][path]" "Apply sql file to database. Default database is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "publish" "" "Publish Odoo Docker image." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "ps" "" "List docker processes." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "pytest-module" "[db][name,path]" "Run module tests with pytest." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "release-module" "[path]" "Create GitHub release for a module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "remove-module" "[db][name]" "Remove target Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "reset-views" "[db][key]" "Execute hard reset on views matching keys." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "restart" "[name]" "Restart docker container." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "save-config" "[name]" "Save Odoo database config." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "setup-mail" "[db]" "Setup outgoing mail config in Odoo db." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "set-admin" "[db]" "Sets the password for the first user in database. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "source" "" "Source the Python virtual env." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "start" "[name][db]" "Start docker container. Options: none, db, admin, odoo, native, mail." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "start-psql" "[db]" "Start PSQL shell in Docker container. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "start-shell" "[db]" "Start Odoo shell from source folder. Default is branch name." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "stop" "[name]" "Stop docker containers." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "test-jsonrpc" "[env]" "Test json rpc connection." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "test-module" "[db][name,path]" "Test target Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "update-app-list" "[db]" "Update app list." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "update-docs" "" "Update project docs." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "update-module" "[db][name,path]" "Update target Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "update-readme" "[path]" "Update Readme file of Odoo module collection." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "update-snippet" "[env][path]" "Update snippet xml definition." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "upload-module" "[env][path]" "Zip and upload Odoo module." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "visualize-dependencies" "[path]" "Generate visualizations of module dependencies." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "version" "" "Show version of required tools." + printf "| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" "zip-module" "[path]" "Create zip file for module." +} function help() { -echo -echo "$1 [options]" -echo -echo "commands:" -echo -column -t -s"|" ./task.md | tail -n +3 -echo + echo + echo "$1 [options]" + echo + echo "commands:" + echo + help-table + echo +} + +generate-help-doc() { + help-table > task.md } if [[ -a ".env" && "$(cat .env | sed 's/^#.*//g')" ]]; then @@ -583,6 +679,31 @@ function test-module() { odoo -d "$DATABASE" -i "$MODULE_NAME" --config "config/odoo.conf" --addons-path="$ADDONS_PATH" --stop-after-init --no-http --test-tags /"$MODULE_NAME" } +function pytest-module() { + DATABASE="$1" + MODULE_PATH="$2" + + # Use default database if second param is not given + if test -z "$2"; then + DATABASE="$ODOO_DATABASE" + MODULE_PATH="$1" + fi + + activate-venv + set-addons-path + + ODOO_CONFIG="tmp/odoo.conf" + echo "Write $ODOO_CONFIG" + + echo "[options]" > "$ODOO_CONFIG" + echo "addons_path=$ADDONS_PATH" >> "$ODOO_CONFIG" + echo "db_host = localhost" >> "$ODOO_CONFIG" + echo "db_password = odoo" >> "$ODOO_CONFIG" + echo "db_user = odoo" >> "$ODOO_CONFIG" + + pytest -s --odoo-config="$ODOO_CONFIG" --odoo-database="$DATABASE" "$MODULE_PATH" +} + function remove-module() { if test -z "$1"; then echo "\$1 is empty."; exit; fi @@ -718,14 +839,32 @@ function convert-database() { echo "Converted database file $1 to ${1}2" } -function git-submodule-update() { +function git-submodule-init() { + echo "Init git submodules." + + # Using "git submodule update --init --recursive" is not possible as modules are registered from different branches + SUBMODULES=$(git config --file .gitmodules --get-regexp url | sed -e 's/submodule.//g' -e 's/.url.*//g') + for SUBMODULE in $SUBMODULES; do + if [ ! -d "$SUBMODULE" ]; then + echo "Initializing submodule: $SUBMODULE" + git submodule update --init "$SUBMODULE" + fi + done +} + +function git-submodule-checkout() { echo "Update git submodules." + + # The --depth flag cannot be used when working on multiple branches in submodules SUBMODULES=$(git config --file .gitmodules --get-regexp url | sed -e 's/submodule.//g' -e 's/.url.*//g') for SUBMODULE in $SUBMODULES; do - # The init flag is required for the inital checkout - # The --depth flag cannot be used when working on multiple branches echo "Update git submodule: $SUBMODULE" - git submodule update --init "$SUBMODULE" + COMMIT_HASH=$(git ls-tree HEAD "$SUBMODULE" | awk '{print $3}') + CWD=$(pwd) + cd "$SUBMODULE" || exit + git stash + git checkout "$COMMIT_HASH" + cd "$CWD" || exit done } @@ -763,10 +902,12 @@ function checkout() { GIT_BRANCH="$2" fi - echo "Switch branch." + echo "Switch current branch to $1." git switch "$1" - git-submodule-update + git-submodule-init + + git-submodule-checkout git-submodule-switch "$1" } @@ -809,9 +950,6 @@ function release-module() { echo "Release notes:" echo "$RELEASE_NOTES" - - # echo "Create release $VERSION ..." - # gh release create "v$VERSION" -t "Release $VERSION" } function zip-module() { @@ -1236,6 +1374,7 @@ function update-docs() { generate-module-overview generate-revisions-doc generate-snippets-doc + generate-help-doc } function visualize-dependencies() { @@ -1325,6 +1464,9 @@ case "$1" in generate-admin-passwd) generate-admin-passwd "$2" ;; + generate-help-doc) + generate-help-doc + ;; generate-module-security) generate-module-security "$2" "$3" ;; @@ -1352,12 +1494,15 @@ case "$1" in git-submodule-remove) git-submodule-remove "$2" ;; + git-submodule-checkout) + git-submodule-checkout + ;; + git-submodule-init) + git-submodule-init + ;; git-submodule-switch) git-submodule-switch "$2" ;; - git-submodule-update) - git-submodule-update - ;; help) help task exit 1 @@ -1444,6 +1589,9 @@ case "$1" in ps) docker ps --format 'table {{.Names}}\t{{.Image}}\t{{(.Label "description")}}\t{{.Status}}' ;; + pytest-module) + pytest-module "$2" "$3" + ;; release-module) release-module "$2" ;; diff --git a/task.md b/task.md index 70fc40c5..646c93d0 100644 --- a/task.md +++ b/task.md @@ -1,79 +1,82 @@ -| command | option | description | -| ------------------------ | ----------------- | ----------------------------------------------------------------------------------------- | -| build | [path] | Build Odoo Docker image. Optionally pass specific Dockerfile. | -| change-uuid | [env] | Change database uuid via xmlrpc. | -| checkout | [branch][branch] | Switch and merge from one branch to another. | -| checkout-config-files | [branch] | Checkout config files from another branch. | -| checkout-revision | [revision] | Run Odoo revision script or checkout revision set by env var. | -| clear-assets | [db] | Clear all assets of Odoo database. | -| clear-filestore | [db] | Clear local filestore folder. No param will clear all filestores. Default is branch name. | -| convert-database | [db] | Convert database backup file from PostgreSQL 9.5 to latest. Default is branch name. | -| create-module | [path] | Create new Odoo module from template. | -| deploy | [name] | Deploy to Kubernets cluster. Options: db, admin, odoo, mail. | -| disable-auto-install | | Disable auto install for enterprise modules. | -| disable-mailserver | [env] | Disable mail server settings via xmlrpc. | -| docker-login | | Setup Docker Hub login credentials. | -| drop-db | [db] | Drop target Odoo database. Default is branch name. | -| edit-env | [env] | Open env file in default editor. | -| generate-admin-passwd | [pass] | Generate hash for Odoo master password. | -| translate-module | [env][path][lang] | Generate translation for Odoo module. | -| generate-module-security | [path][model] | Generate model access file for a selected model of a module. | -| get-module-version | [path] | Get module version from manifest. | -| git-feature-branch | [path] | Create feature branch for Odoo module. | -| git-mig-branch | [path] | Create migration branch for Odoo module. | -| git-submodule-add | [url] [path] | Add git submodule. | -| git-submodule-list | | List path and url of submodules. | -| git-submodule-pull | | Pull alls submodules. | -| git-submodule-remove | [path] | Remove git submodule. | -| git-submodule-switch | [branch] | Switch branch for all submodules. | -| git-submodule-update | | Update submodules from .gitmodules file. | -| import-csv | [db][path] | Import data from csv. Filename must match PostgreSQL table name. | -| info | | Show values of project env vars. | -| init-db | [db] | Initialize the Odoo database. Default is branch name. | -| init-nextcloud-env | [env] | Create env file for Nextcloud instance. | -| init-odoo-env | [env] | Create env file for Odoo Instance. | -| init-venv | | Initialize python virtual env. | -| init-module | [db][name,path] | Initialize Odoo module. Default database is branch name. | -| load-language | [db][lang] | Install language package in Odoo db. | -| install-native | | Install Odoo requirements in source folder. | -| install-odoo-scripts | | Install Odoo scripts. | -| install-requirements | [db][path] | Install python packages from requirements.txt. | -| install-snippet | [env][path] | Install snippet xml definition. | -| down | [name] | Remove docker containers and volumes. Options: none, db, admin, odoo, mail. | -| lint-module | [path] | Run pylint odoo for module. | -| lint-snippets | | Run checks for all snippets. | -| list | | List Docker containers. | -| list-addons | | List odoo addons. | -| list-env | | List env files. | -| logs | | Tail Odoo Docker container logs. | -| node-install | | Install build dependencies. | -| node-dev | | Start vuepress development server. | -| node-build | | Create vuepress build. | -| node-serve-build | | Serve vuepress build. | -| odoo-cloc | [db] | Count custom line of codes. Default is branch name. | -| patch-database | [db][path] | Apply sql file to database. Default database is branch name. | -| publish | | Publish Odoo Docker image. | -| ps | | List docker processes. | -| release-module | [path] | Create GitHub release for a module. | -| remove-module | [db][name] | Remove target Odoo module. | -| reset-views | [db][key] | Execute hard reset on views matching keys. | -| restart | [name] | Restart docker container. | -| save-config | [name] | Save Odoo database config | -| setup-mail | [db] | Setup outgoing mail config in Odoo db. | -| set-admin | [db] | Sets the password for the first user in database. Default is branch name. | -| source | | Source the Python virtual env. | -| start | [name][db] | Start docker container. Options: none, db, admin, odoo, native, mail. | -| start-psql | [db] | Start PSQL shell in Docker container. Default is branch name. | -| start-shell | [db] | Start Odoo shell from source folder. Default is branch name. | -| stop | [name] | Stop docker containers. | -| test-jsonrpc | [env] | Test json rpc connection. | -| test-module | [db][name,path] | Test target Odoo module. | -| update-app-list | [db] | Update app list. | -| update-docs | | Update project docs. | -| update-module | [db][name,path] | Update target Odoo module. | -| update-readme | [path] | Update Readme file of Odoo module collection. | -| update-snippet | [env][path] | Update snippet xml definition. | -| upload-module | [env][path] | Zip and upload Odoo module. | -| visualize-dependencies | [path] | Generate visualizations of module dependencies. | -| version | | Show version of required tools. | -| zip-module | [path] | Create zip file for module. | \ No newline at end of file +| Command | Option | Description | +|---------------------------|----------------------|--------------------------------------------------------------------------------------------| +| build | [path] | Build Odoo Docker image. Optionally pass specific Dockerfile. | +| change-uuid | [env] | Change database uuid via xmlrpc. | +| checkout | [branch][branch] | Switch and merge from one branch to another. | +| checkout-config-files | [branch] | Checkout config files from another branch. | +| checkout-revision | [revision] | Run Odoo revision script or checkout revision set by env var. | +| clear-assets | [db] | Clear all assets of Odoo database. | +| clear-filestore | [db] | Clear local filestore folder. No param will clear all filestores. Default is branch name. | +| convert-database | [db] | Convert database backup file from PostgreSQL 9.5 to latest. Default is branch name. | +| create-module | [path] | Create new Odoo module from template. | +| deploy | [name] | Deploy to Kubernetes cluster. Options: db, admin, odoo, mail. | +| disable-auto-install | | Disable auto install for enterprise modules. | +| disable-mailserver | [env] | Disable mail server settings via xmlrpc. | +| docker-login | | Setup Docker Hub login credentials. | +| drop-db | [db] | Drop target Odoo database. Default is branch name. | +| edit-env | [env] | Open env file in default editor. | +| generate-admin-passwd | [pass] | Generate hash for Odoo master password. | +| translate-module | [env][path][lang] | Generate translation for Odoo module. | +| generate-help-doc | | Write help table to task.md file. | +| generate-module-security | [path][model] | Generate model access file for a selected model of a module. | +| get-module-version | [path] | Get module version from manifest. | +| git-feature-branch | [path] | Create feature branch for Odoo module. | +| git-mig-branch | [path] | Create migration branch for Odoo module. | +| git-submodule-add | [url] [path] | Add git submodule. | +| git-submodule-checkout | | Update submodules listed in the .gitmodules file. | +| git-submodule-list | | List path and url of submodules. | +| git-submodule-init | | Init submodules listed in the .gitmodules file. | +| git-submodule-pull | | Pull all submodules. | +| git-submodule-remove | [path] | Remove git submodule. | +| git-submodule-switch | [branch] | Switch branch for all submodules. | +| import-csv | [db][path] | Import data from csv. Filename must match PostgreSQL table name. | +| info | | Show values of project env vars. | +| init-db | [db] | Initialize the Odoo database. Default is branch name. | +| init-nextcloud-env | [env] | Create env file for Nextcloud instance. | +| init-odoo-env | [env] | Create env file for Odoo Instance. | +| init-venv | | Initialize python virtual env. | +| init-module | [db][name,path] | Initialize Odoo module. Default database is branch name. | +| load-language | [db][lang] | Install language package in Odoo db. | +| install-native | | Install Odoo requirements in source folder. | +| install-odoo-scripts | | Install Odoo scripts. | +| install-requirements | [db][path] | Install python packages from requirements.txt. | +| install-snippet | [env][path] | Install snippet xml definition. | +| down | [name] | Remove docker containers and volumes. Options: none, db, admin, odoo, mail. | +| lint-module | [path] | Run pylint odoo for module. | +| lint-snippets | | Run checks for all snippets. | +| list | | List Docker containers. | +| list-addons | | List Odoo addons. | +| list-env | | List env files. | +| logs | | Tail Odoo Docker container logs. | +| node-install | | Install build dependencies. | +| node-dev | | Start vuepress development server. | +| node-build | | Create vuepress build. | +| node-serve-build | | Serve vuepress build. | +| odoo-cloc | [db] | Count custom line of codes. Default is branch name. | +| patch-database | [db][path] | Apply sql file to database. Default database is branch name. | +| publish | | Publish Odoo Docker image. | +| ps | | List docker processes. | +| pytest-module | [db][name,path] | Run module tests with pytest. | +| release-module | [path] | Create GitHub release for a module. | +| remove-module | [db][name] | Remove target Odoo module. | +| reset-views | [db][key] | Execute hard reset on views matching keys. | +| restart | [name] | Restart docker container. | +| save-config | [name] | Save Odoo database config. | +| setup-mail | [db] | Setup outgoing mail config in Odoo db. | +| set-admin | [db] | Sets the password for the first user in database. Default is branch name. | +| source | | Source the Python virtual env. | +| start | [name][db] | Start docker container. Options: none, db, admin, odoo, native, mail. | +| start-psql | [db] | Start PSQL shell in Docker container. Default is branch name. | +| start-shell | [db] | Start Odoo shell from source folder. Default is branch name. | +| stop | [name] | Stop docker containers. | +| test-jsonrpc | [env] | Test json rpc connection. | +| test-module | [db][name,path] | Test target Odoo module. | +| update-app-list | [db] | Update app list. | +| update-docs | | Update project docs. | +| update-module | [db][name,path] | Update target Odoo module. | +| update-readme | [path] | Update Readme file of Odoo module collection. | +| update-snippet | [env][path] | Update snippet xml definition. | +| upload-module | [env][path] | Zip and upload Odoo module. | +| visualize-dependencies | [path] | Generate visualizations of module dependencies. | +| version | | Show version of required tools. | +| zip-module | [path] | Create zip file for module. |