sync from 14.0
This commit is contained in:
1 parent
7c7a37231d
commit
d99f696cee
12 files changed
+179
-1
No files matched your search
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/service/server.py"
|
||||
FIND="for db_name, registry in registries.d.items()"
|
||||
REPLACE="for db_name, registry in registries.d.copy().items()"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Reference in new issue
Block a user