diff --git a/odoo_module_migrate/migration_scripts/migrate_170_180.py b/odoo_module_migrate/migration_scripts/migrate_170_180.py
index 930ebf72..5a263cf6 100644
--- a/odoo_module_migrate/migration_scripts/migrate_170_180.py
+++ b/odoo_module_migrate/migration_scripts/migrate_170_180.py
@@ -100,8 +100,108 @@ def replace_user_has_groups(
logger.error(f"Error processing file {file}: {str(e)}")
+def remove_deprecated_kanban_click_classes(
+ logger, module_path, module_name, manifest_path, migration_steps, tools
+):
+ files_to_process = tools.get_files(module_path, (".xml",))
+
+ replaces = {
+ "oe_kanban_global_click_edit": "",
+ "oe_kanban_global_click": "",
+ }
+
+ for file in files_to_process:
+ try:
+ tools._replace_in_file(
+ file,
+ replaces,
+ log_message=f"Remove deprecated kanban click classes in file: {file}",
+ )
+ except Exception as e:
+ logger.error(f"Error processing file {file}: {str(e)}")
+
+
+def replace_kanban_color_picker_widget(
+ logger, module_path, module_name, manifest_path, migration_steps, tools
+):
+ files_to_process = tools.get_files(module_path, (".xml",))
+
+ replaces = {
+ # Case 1: Match any ul tag containing both oe_kanban_colorpicker class and data-field
+ # Example:
+ # Example:
+ r']*?class="[^"]*?oe_kanban_colorpicker[^"]*?"[^>]*?data-field="([^"]+)"[^>]*?>(?:
)?': r'',
+ # Case 2: Same as Case 1 but with data-field appearing before class
+ # Example:
+ # Example:
+ r']*?data-field="([^"]+)"[^>]*?class="[^"]*?oe_kanban_colorpicker[^"]*?"[^>]*?>(?:
)?': r'',
+ }
+
+ for file in files_to_process:
+ try:
+ tools._replace_in_file(
+ file,
+ replaces,
+ log_message=f"Replace kanban colorpicker with field widget in file: {file}",
+ )
+ except Exception as e:
+ logger.error(f"Error processing file {file}: {str(e)}")
+
+
+def remove_kanban_tooltip(
+ logger, module_path, module_name, manifest_path, migration_steps, tools
+):
+ files_to_process = tools.get_files(module_path, (".xml",))
+ reg_tooltip_template = (
+ r"""]*>[\s\S]*?\s*"""
+ )
+ reg_tooltip_attr = r"""\s+tooltip=["']kanban-tooltip["']"""
+
+ replaces = {
+ reg_tooltip_template: "",
+ reg_tooltip_attr: "",
+ }
+
+ for file in files_to_process:
+ try:
+ tools._replace_in_file(
+ file,
+ replaces,
+ log_message=f"Removed kanban tooltip feature in file: {file}",
+ )
+ except Exception as e:
+ logger.error(f"Error processing file {file}: {str(e)}")
+
+
+def replace_type_edit(
+ logger, module_path, module_name, manifest_path, migration_steps, tools
+):
+ """Replace type='edit' with type='open' in elements."""
+ files_to_process = tools.get_files(module_path, (".xml",))
+
+ reg_type_edit = r"""type=["']edit["']"""
+
+ replaces = {
+ reg_type_edit: 'type="open"',
+ }
+
+ for file in files_to_process:
+ try:
+ tools._replace_in_file(
+ file,
+ replaces,
+ log_message=f"Replaced type='edit' with type='open' in file: {file}",
+ )
+ except Exception as e:
+ logger.error(f"Error processing file {file}: {str(e)}")
+
+
class MigrationScript(BaseMigrationScript):
_GLOBAL_FUNCTIONS = [
+ remove_deprecated_kanban_click_classes,
+ replace_kanban_color_picker_widget,
+ remove_kanban_tooltip,
+ replace_type_edit,
replace_tree_with_list_in_views,
replace_chatter_blocks,
replace_user_has_groups,
diff --git a/odoo_module_migrate/migration_scripts/text_warnings/migrate_170_180/kanban_color.yaml b/odoo_module_migrate/migration_scripts/text_warnings/migrate_170_180/kanban_color.yaml
new file mode 100644
index 00000000..5cd9e898
--- /dev/null
+++ b/odoo_module_migrate/migration_scripts/text_warnings/migrate_170_180/kanban_color.yaml
@@ -0,0 +1,2 @@
+.xml:
+ (?:t-attf-class|class)="[^"]*(?:kanban_getcolor|kanban_color|kanban_getcolorname)\([^"]*"|class="[^"]*oe_kanban_color_\d+[^"]*": "[18.0] Kanban color methods (kanban_getcolor, kanban_color, kanban_getcolorname) and static color classes (oe_kanban_color_X) have been deprecated in favor of the highlight_color attribute on kanban root node. This attribute will properly color the left border of the kanban cards. No need to set color classes or use color methods anymore. These methods will be removed in 18.0. More details: https://github.com/odoo/odoo/pull/167751"
diff --git a/odoo_module_migrate/migration_scripts/text_warnings/migrate_170_180/kanban_image.yaml b/odoo_module_migrate/migration_scripts/text_warnings/migrate_170_180/kanban_image.yaml
new file mode 100644
index 00000000..ff92cd58
--- /dev/null
+++ b/odoo_module_migrate/migration_scripts/text_warnings/migrate_170_180/kanban_image.yaml
@@ -0,0 +1,2 @@
+.xml:
+ kanban_image\(['"][^'"]+["']\s*,\s*['"][^'"]+["']\s*,\s*[^)]+\): "[18.0] The kanban_image helper is deprecated in favor of . More details: https://github.com/odoo/odoo/pull/167751/commits/6c5896724abee4cee0a26d0b41de9781c8e51621"
diff --git a/tests/data_result/module_170_180/views/res_partner.xml b/tests/data_result/module_170_180/views/res_partner.xml
index ff22ea0c..2d011a70 100644
--- a/tests/data_result/module_170_180/views/res_partner.xml
+++ b/tests/data_result/module_170_180/views/res_partner.xml
@@ -10,7 +10,7 @@
-
+
res.partner.form
res.partner
@@ -62,4 +62,56 @@
+
+
+ res.partner.view.kanban
+ res.partner
+
+
+
+
+
+
+
+
+
+
+
+
+ res.partner.view.kanban
+ res.partner
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data_template/module_170/views/res_partner.xml b/tests/data_template/module_170/views/res_partner.xml
index 9beaf9b9..2aee9de0 100644
--- a/tests/data_template/module_170/views/res_partner.xml
+++ b/tests/data_template/module_170/views/res_partner.xml
@@ -10,7 +10,7 @@
-
+
res.partner.form
res.partner
@@ -69,4 +69,67 @@
+
+
+ res.partner.view.kanban
+ res.partner
+
+
+
+
+
+
+
+
+
+
+
+
+ res.partner.view.kanban
+ res.partner
+
+
+
+
+
+
+
+
+
+
+
+
+