Skip to content
Snippets Groups Projects
user avatar
Julien (jula) authored
__Current behavior before PR:__
The `abort_and_redirect` method uses `werkzeug.utils.redirect` which converts the input URL to a string in werkzeug 0.16.1.
However when running odoo with python 3.10, [werkzeug version 2.0.2 is used](https://github.com/odoo/odoo/blob/8985426bf38affedb82990bd2158049b4d6b0bce/requirements.txt#L58).
In this version if the input is not a string `TypeError: replace() takes 1 positional argument but 3 were given - - -` is raised.

__Description of the fix:__
Calls `to_url` method on `url_redirect` to convert it into a string before passing it to `abort_and_redirect`.

__Steps to reproduce the issue:__
1. Run odoo-bin with python 3.10 **or** directly use `werkzeug` version 2.0.2 (`pip install werkzeug==2.0.2`).
2. Go to http://localhost:8069/web/database/selector (in private window)
3. Open a database in Odoo 14
↳ Internal Server Error

Closes: https://github.com/odoo/odoo/issues/111490



opw-3222058

closes odoo/odoo#117959

Signed-off-by: default avatarJulien Castiaux (juc) <juc@odoo.com>
cfe7a8db
History

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials