[ADD] Allows applying patches to installed modules #4

Merged
jegomez merged 1 commits from allow-patches into main 2021-04-29 01:06:02 +00:00
3 changed files with 44 additions and 0 deletions

View File

@ -71,3 +71,9 @@ git pull --recurse-submodules
sudo ./install_all.sh sudo ./install_all.sh
``` ```
### To apply patches to installed modules:
```sh
sudo ./apply_patches.sh
```

21
apply_patches.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
#
# Installs selected content from the downloaded repos into a production folder
#
if [ $UID != 0 ]; then
echo "You need administration privileges to run this script."
exit 1
fi
DESTDIR=/opt/odoo
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " Patch OCA modules"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
DEST=$DESTDIR/community/auth_oauth_multi_token/
OPTIONS="--directory=$DEST --strip=1"
patch $OPTIONS < patches/20210420_auth-oauth-multi-token_error-in-login.patch

View File

@ -0,0 +1,17 @@
diff -rupN auth_oauth_multi_token/models/res_users.py auth_oauth_multi_token.patch/models/res_users.py
--- auth_oauth_multi_token/models/res_users.py 2021-04-15 03:35:47.362795561 +0000
+++ auth_oauth_multi_token.patch/models/res_users.py 2021-04-20 22:54:51.992899568 +0000
@@ -69,10 +69,10 @@ class ResUsers(models.Model):
res.oauth_master_uuid = self._generate_oauth_master_uuid()
@api.model
- def _check_credentials(self, password):
+ def _check_credentials(self, password, env):
"""Override to check credentials against multi tokens."""
try:
- return super()._check_credentials(password)
+ return super()._check_credentials(password, env)
except exceptions.AccessDenied:
res = self.multi_token_model.sudo().search(
[