diff --git a/odoo_module_migrate/migration_scripts/migrate_170_180.py b/odoo_module_migrate/migration_scripts/migrate_170_180.py index 8734fa08..bf462044 100644 --- a/odoo_module_migrate/migration_scripts/migrate_170_180.py +++ b/odoo_module_migrate/migration_scripts/migrate_170_180.py @@ -100,9 +100,42 @@ def replace_user_has_groups( logger.error(f"Error processing file {file}: {str(e)}") +def replace_slugify( + logger, module_path, module_name, manifest_path, migration_steps, tools +): + files_to_process = tools.get_files(module_path, (".py",)) + + for file in files_to_process: + try: + content = tools._read_content(file) + content = re.sub( + r"from\s+odoo\.addons\.http_routing\.models\.ir_http\s+import\s+slugify\b.*\n", + "", + content, + ) + # process in controller (*.py) file are using request + has_request = "request" in content + if has_request: + content = re.sub( + r"""(?