Skip to content

Commit f966edf

Browse files
committed
Release 1.3.0 (2023-03-28)
Added ----- - Added new option `--no-fetch` to cmd `odoo-helper link` that allows to disable fetching repositories (from `odoo_requirements.txt` and `oca_dependencies.txt`) Changed ------- - Automatically apply patch to run tours on Chrome 111 for Odoo 12. See details: - odoo/odoo#114930 - odoo/odoo#115782 Fixed ----- - Force link modules during migration tests
2 parents bb4a75a + 48b0395 commit f966edf

File tree

7 files changed

+67
-17
lines changed

7 files changed

+67
-17
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
# Release Notes
22

3+
## Release 1.3.0 (2023-03-28)
4+
5+
### Added
6+
7+
- Added new option `--no-fetch` to cmd `odoo-helper link` that allows to disable
8+
fetching repositories (from `odoo_requirements.txt` and `oca_dependencies.txt`)
9+
10+
### Changed
11+
12+
- Automatically apply patch to run tours on Chrome 111 for Odoo 12.
13+
See details:
14+
- https://github.com/odoo/odoo/pull/114930
15+
- https://github.com/odoo/odoo/pull/115782
16+
17+
### Fixed
18+
19+
- Force link modules during migration tests
20+
21+
---
22+
323
## Release 1.2.0 (2023-02-11)
424

525
### Added
626

7-
Added `-t` shortcut for `--create-test-db` option of `odoo-helper test` command
27+
- Added `-t` shortcut for `--create-test-db` option of `odoo-helper test` command
828

929
---
1030

lib/ci.bash

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ function ci_do_forwardport {
666666
--fm|--forward-migrations)
667667
forward_migrations=1;
668668
;;
669-
--no|--no-forward-migrations)
669+
--no-fm|--no-forward-migrations)
670670
forward_migrations=0;
671671
;;
672672
--mm|--migrate-modules)
@@ -759,8 +759,10 @@ function ci_do_forwardport {
759759
local migration_dst=${migration_dst_prefix}${migration_name};
760760
if [ -d "$migration_src" ] && [ ! -d "${migration_dst}" ]; then
761761
if [ "$forward_migrations" -eq 1 ]; then
762-
echoe -e "${LBLUEC}INFO${NC}: forwarding migration ${YELLOWC}${addon_name}${NC} (${BLUEC}${migration_name}${NC}) from ${YELLOWC}${src_branch}${NC}.${BLUEC}${migration_name}${NC} to ${YELLOWC}${dst_branch}${NC}.${BLUEC}${migration_name}${NC}!";
763-
git mv "$migration_src" "${migration_dst_prefix}${migration_name}";
762+
echoe -e "${LBLUEC}INFO${NC}: Forwarding migration ${YELLOWC}${addon_name}${NC} (${BLUEC}${migration_name}${NC}) from ${YELLOWC}${src_branch}${NC}.${BLUEC}${migration_name}${NC} to ${YELLOWC}${dst_branch}${NC}.${BLUEC}${migration_name}${NC}!";
763+
if ! git mv "$migration_src" "${migration_dst_prefix}${migration_name}"; then
764+
echoe -e "${REDC}ERROR${NC}: Cannot forward migration ${YELLOWC}${addon_name}${NC} (${BLUEC}${migration_name}${NC}) from ${YELLOWC}${src_branch}${NC}.${BLUEC}${migration_name}${NC} to ${YELLOWC}${dst_branch}${NC}.${BLUEC}${migration_name}${NC}!";
765+
fi
764766
else
765767
echoe -e "${YELLOWC}WARNING${NC}: There is chaged migrations for add ${BLUEC}${addon_name}${NC} in this forwardport, but automitic forwardport of migrations disables.";
766768
fi

lib/install.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,12 @@ function odoo_run_setup_py {
11891189

11901190
# Install odoo
11911191
(cd "$ODOO_PATH" && exec_py setup.py -q develop);
1192+
1193+
# Apply patch to run tours in Chrome 111 for Odoo 12.0
1194+
if [ "$(odoo_get_major_version)" -eq 12 ]; then
1195+
sed -i -E 's@([\t ]+)(self\.ws = websocket\.create_connection\(self\.ws_url\))@\1# Automatic odoo-helper fix for ability to run tours in Chrome 111\n\1# See: https://github.com/odoo/odoo/pull/114930\n\1# See: https://github.com/odoo/odoo/pull/115782\n\1# \2\n\1self.ws = websocket.create_connection(self.ws_url, suppress_origin=True)@gm' "$ODOO_PATH/odoo/tests/common.py";
1196+
fi
1197+
11921198
}
11931199

11941200

lib/link.bash

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ function link_is_addon_linked {
5454
}
5555

5656

57-
# link_module_impl <source_path> <dest_path> <force: on|off> <py-deps-manifest: on|off>
57+
# link_module_impl <source_path> <dest_path> <force: on|off> <py-deps-manifest: on|off> <fetch-recursive: on|off>
5858
function link_module_impl {
5959
local src; src=$(readlink -f "$1");
6060
local dest=$2;
6161
local force=$3;
62-
local py_deps_manifest="${4:-off}";
62+
local py_deps_manifest="$4";
63+
local fetch_recursive="$5";
6364

6465
if [ "$force" == "on" ] && { [ -e "$dest" ] || [ -L "$dest" ]; }; then
6566
echov "Rewriting module $dest...";
@@ -79,9 +80,12 @@ function link_module_impl {
7980
else
8081
echov "Module $src already linked to $dest";
8182
fi
82-
fetch_requirements "$dest";
8383
fetch_pip_requirements "$dest";
84-
fetch_oca_requirements "$dest";
84+
85+
if [ "$fetch_recursive" == "on" ]; then
86+
fetch_requirements "$dest";
87+
fetch_oca_requirements "$dest";
88+
fi
8589

8690
if [ "$py_deps_manifest" == "on" ] && [ -f "$dest/__manifest__.py" ]; then
8791
local py_deps;
@@ -98,10 +102,12 @@ function link_module_impl {
98102
# --force
99103
# --module-name <module name>
100104
# --fetch-manifest-py-deps
105+
# --fetch-recursive <on|off>
101106
function link_module {
102107
local force=off;
103108
local fetch_manifest_py_deps=off;
104109
local module_name;
110+
local fetch_recursive=on;
105111

106112
# Parse command line options and run commands
107113
if [[ $# -lt 1 ]]; then
@@ -124,6 +130,10 @@ function link_module {
124130
module_name="$2";
125131
shift;
126132
;;
133+
--fetch-recursive)
134+
fetch_recursive="$2";
135+
shift;
136+
;;
127137
*)
128138
echo "Unknown option $key";
129139
return 1;
@@ -153,26 +163,28 @@ function link_module {
153163
# single module repo
154164
local basename_repo;
155165
basename_repo=$(basename "$repo_path");
156-
link_module_impl "$repo_path" "$ADDONS_DIR/${module_name:-$basename_repo}" "$force" "$fetch_manifest_py_deps";
166+
link_module_impl "$repo_path" "$ADDONS_DIR/${module_name:-$basename_repo}" "$force" "$fetch_manifest_py_deps" "$fetch_recursive";
157167
else
158168
# multi module repo
159169
if [ -z "$module_name" ]; then
160170
# Check for requirements files in repository root dir
161-
fetch_requirements "$repo_path";
162171
fetch_pip_requirements "$repo_path";
163-
fetch_oca_requirements "$repo_path";
172+
if [ "$fetch_recursive" == "on" ]; then
173+
fetch_requirements "$repo_path";
174+
fetch_oca_requirements "$repo_path";
175+
fi
164176

165177
# No module name specified, then all modules in repository should be linked
166178
for file in "$repo_path"/*; do
167179
local base_filename;
168180
base_filename=$(basename "$file");
169181
if is_odoo_module "$file" && addons_is_installable "$file"; then
170182
# link module
171-
link_module_impl "$file" "$ADDONS_DIR/$base_filename" "$force" "$fetch_manifest_py_deps";
183+
link_module_impl "$file" "$ADDONS_DIR/$base_filename" "$force" "$fetch_manifest_py_deps" "$fetch_recursive";
172184
elif [ -d "$file" ] && ! is_odoo_module "$file" && [ "$base_filename" != 'setup' ]; then
173185
# if it is directory but not odoo module,
174186
# and not 'setup' dir, then recursively look for addons there
175-
local link_module_opts=( );
187+
local link_module_opts=( --fetch-recursive "$fetch_recursive" );
176188
if [ "$force" == on ]; then
177189
link_module_opts+=( --force )
178190
fi
@@ -184,7 +196,7 @@ function link_module {
184196
done
185197
else
186198
# Module name specified, then only single module should be linked
187-
link_module_impl "$repo_path/$module_name" "$ADDONS_DIR/$module_name" "$force" "$fetch_manifest_py_deps";
199+
link_module_impl "$repo_path/$module_name" "$ADDONS_DIR/$module_name" "$force" "$fetch_manifest_py_deps" "$fetch_recursive";
188200
fi
189201
fi
190202
}
@@ -200,6 +212,7 @@ function link_command {
200212
-f|--force - rewrite links if already exists
201213
--fetch-manifest-py-deps - fetch python dependencies from addon's manifest
202214
--module-name <name> - name of module to link from repo
215+
--no-fetch - Do not fetch repositories recursively
203216
--ual - update addons list after link
204217
";
205218

@@ -231,6 +244,9 @@ function link_command {
231244
link_module_opts+=( --module-name "$2" );
232245
shift;
233246
;;
247+
--no-fetch)
248+
link_module_opts+=( --fetch-recursive off );
249+
;;
234250
--ual)
235251
ual=1;
236252
;;

lib/recursion.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ function recursion_protection_check {
7676
}
7777

7878

79-
# Close recursion protection for a key
79+
# Close recursion protection for a key.
80+
# Clear recursion cache for specified key
8081
#
8182
# recursion_protection_close <key>
8283
function recursion_protection_close {

lib/test.bash

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ function test_run_tests {
235235
git fetch origin "$ODOO_VERSION" && \
236236
git checkout origin/"$ODOO_VERSION");
237237
fi
238+
239+
link_module --force "$test_migration_repo";
240+
241+
# Clear recursion protection, to able to link same repo later
242+
recursion_protection_close "link_module";
238243
fi
239244

240245

@@ -280,7 +285,7 @@ function test_run_tests {
280285
(cd "$test_migration_repo" && \
281286
git checkout "$test_migration_branch");
282287

283-
link_module "$test_migration_repo";
288+
link_module --force "$test_migration_repo";
284289
addons_update_module_list "$test_db_name";
285290

286291
# TODO: git clean -fdx?

lib/version.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# Odoo Helper Scripts: Version
1010

1111
# Define version number
12-
ODOO_HELPER_VERSION="1.2.0";
12+
ODOO_HELPER_VERSION="1.3.0";
1313
ODOO_HELPER_CONFIG_VERSION="1";

0 commit comments

Comments
 (0)