Skip to content

Commit

Permalink
Automatically apply patch to run tours on Chrome 111 for Odoo 12
Browse files Browse the repository at this point in the history
For more info, see:
- odoo/odoo#114930
- odoo/odoo#115782
  • Loading branch information
katyukha committed Mar 28, 2023
1 parent 331834f commit af444ae
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions subpackages/lib/source/odood/lib/install/odoo.d
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,26 @@ void installOdoo(in Project project) {
project.odoo.path.join("setup.py").writeFile(setup_content);
}

// Apply patch to fix chrome "forbidden" errors
// See https://github.com/odoo/odoo/pull/114930
// And https://github.com/odoo/odoo/pull/115782
if (project.odoo.serie == 12) {
infof("Applying automatic patch to be able to run tours with Chrome 111");
auto common_content = project.odoo.path.join(
"odoo", "tests", "common.py"
).readFileText().
replaceAll(
regex(r"^([\t ]+)(self\.ws = websocket\.create_connection\(self\.ws_url\))$", "gm"),
"$1# Automatic Odood patch 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)");
project.odoo.path.join(
"odoo", "tests", "common.py"
).writeFile(common_content);
}

project.venv.python(
["setup.py", "develop"],
project.odoo.path);
Expand Down

0 comments on commit af444ae

Please sign in to comment.