From db1cfc9cff2e84cc1e5d41e9352fde83ccddaf51 Mon Sep 17 00:00:00 2001 From: Janik von Rotz Date: Tue, 16 Mar 2021 19:22:22 +0100 Subject: [PATCH] odoo remove module task --- task | 18 ++++++++++++++++++ task.md | 1 + 2 files changed, 19 insertions(+) diff --git a/task b/task index 7d5f145f..a77d292e 100755 --- a/task +++ b/task @@ -64,12 +64,27 @@ function update-module() { } function install-module() { + if test -z "$1"; then echo "\$1 is empty"; exit; fi + if test -z "$2"; then echo "\$2 is empty"; exit; fi + cd odoo locale activate-venv ./odoo-bin -d $1 -i $2 --config '../config/odoo-src.conf' --stop-after-init --no-http } +function remove-module() { + if test -z "$1"; then echo "\$1 is empty"; exit; fi + if test -z "$2"; then echo "\$2 is empty"; exit; fi + + cd odoo + locale + activate-venv + echo "self.env['ir.module.module'].search([('name', '=', '$2')]).button_immediate_uninstall()" | + python3 odoo-bin shell -d $1 --config '../config/odoo-src.conf' --no-http +} + + function create-module() { if test -z "$1"; then echo "\$1 is empty"; exit; fi @@ -225,6 +240,9 @@ case "$1" in install-module) install-module $2 $3 ;; + remove-module) + remove-module $2 $3 + ;; release-module) release-module $2 ;; diff --git a/task.md b/task.md index 6b0a45d6..662bd723 100644 --- a/task.md +++ b/task.md @@ -14,6 +14,7 @@ start-shell|[db]|Start Odoo shell from source folder. create-module|[name]|Create new Odoo module from template. install-module|[db] [name]|Install target Odoo module. update-module|[db] [name]|Update target Odoo module. +remove-module|[db] [name]|Remove target Odoo module. zip-module|[path]|Create zip file for module. release-module|[path]|Create GitHub release for module. drop-db|[db]|Drop target Odoo database.