This commit is contained in:
Janik von Rotz committed 2021-08-19 17:43:19 +02:00
1 parent 96d8a41a61
commit e1b3992e63
3 files changed
+25 -2

No files matched your search

+23 -1
View File
@@ -14,8 +14,14 @@ echo
PATH="$PATH:./odoo"
GIT_TAG=0
GIT_BRANCH=$(git symbolic-ref --short -q HEAD)
export POSTGRES_USER=odoo
export POSTGRES_PASSWORD=odoo
export ODOO_REVISION=$GIT_BRANCH
if [ -a ".env" ]; then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
function get-module-version() {
if test -z "$1"
then
@@ -240,7 +246,7 @@ function clear-assets() {
docker exec db psql postgres://odoo:odoo@localhost/$DATABASE -c "select id,name from ir_attachment where res_model='ir.ui.view' and name like '%assets_%';"
docker exec db psql postgres://odoo:odoo@localhost/$DATABASE -c "delete from ir_attachment where res_model='ir.ui.view' and name like '%assets_%';"
echo "Restart your docker service".
echo "Restart your docker service."
}
function convert-database() {
@@ -430,6 +436,19 @@ function git-list-submodules() {
git config --file .gitmodules --get-regexp url | sed -e 's/submodule.//g' -e 's/.url//g' | awk '{ print $1 "," $2}'
}
function patch-database() {
if test -z "$1"; then echo "\$1 is empty"; exit; fi
if test -z "$2"; then echo "\$1 is empty"; exit; fi
# Generate view name from filename
FILENAME=$(basename $2)
echo "Apply patch $FILENAME to Database $1."
cat $2 | docker exec -i db psql postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost/$1
echo "Patching database succeeded"
}
case "$1" in
disable-auto-install)
disable-auto-install
@@ -539,6 +558,9 @@ case "$1" in
upload-module)
upload-module $2 $3
;;
patch-database)
patch-database $2 $3
;;
*)
help task
exit 1
+1
View File
@@ -19,6 +19,7 @@
| lint-module | [path] | Run pylint odoo for module. |
| logs | | Tail Odoo Docker container logs. |
| odoo-cloc | [db] | Count custom line of codes. |
| patch-database | [db] [path] | Apply sql file to database |
| release-module | [path] | Create GitHub release for a module. |
| remove-module | [db] [name] | Remove target Odoo module. |
| remove-submodule | [path] | Remove git submodule. |