-
-
Notifications
You must be signed in to change notification settings - Fork 826
[19.0][OU-ADD] website_crm_partner_assign: Migration scripts #5883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
BhaveshHeliconia
wants to merge
1
commit into
OCA:19.0
from
HeliconiaIO:19.0-mig-website_crm_partner_assign
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
openupgrade_scripts/scripts/website_crm_partner_assign/19.0.1.2/pre-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Copyright 2026 Heliconia Solutions Pvt. Ltd. | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
| xmlid_renames = [ | ||
| ( | ||
| "website_crm_partner_assign.res_partner_grade_action", | ||
| "partnership.res_partner_grade_action", | ||
| ), | ||
| ( | ||
| "website_crm_partner_assign.access_res_partner_grade", | ||
| "partnership.access_res_partner_grade", | ||
| ), | ||
| ( | ||
| "website_crm_partner_assign.access_res_partner_grade_manager", | ||
| "partnership.access_res_partner_grade_manager", | ||
| ), | ||
| ( | ||
| "website_crm_partner_assign.menu_res_partner_grade_action", | ||
| "partnership.menu_res_partner_grade_action", | ||
| ), | ||
| ( | ||
| "website_crm_partner_assign.res_partner_grade_data_bronze", | ||
| "partnership.res_partner_grade_data_bronze", | ||
| ), | ||
| ( | ||
| "website_crm_partner_assign.res_partner_grade_data_gold", | ||
| "partnership.res_partner_grade_data_gold", | ||
| ), | ||
| ( | ||
| "website_crm_partner_assign.res_partner_grade_data_silver", | ||
| "partnership.res_partner_grade_data_silver", | ||
| ), | ||
| ] | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| cr = env.cr | ||
| for old_xmlid, new_xmlid in xmlid_renames: | ||
| old_mod, old_name = old_xmlid.split(".", 1) | ||
| new_mod, new_name = new_xmlid.split(".", 1) | ||
| cr.execute( | ||
| "SELECT 1 FROM ir_model_data WHERE module = %s AND name = %s", | ||
| (new_mod, new_name), | ||
| ) | ||
| if cr.fetchone(): | ||
| openupgrade.logged_query( | ||
| cr, | ||
| "DELETE FROM ir_model_data WHERE module = %s AND name = %s", | ||
| (old_mod, old_name), | ||
| ) | ||
| else: | ||
| openupgrade.rename_xmlids(cr, [(old_xmlid, new_xmlid)]) | ||
34 changes: 34 additions & 0 deletions
34
openupgrade_scripts/scripts/website_crm_partner_assign/19.0.1.2/upgrade_analysis_work.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ---Models in module 'website_crm_partner_assign'--- | ||
| model res.partner.grade (moved to partnership) | ||
|
|
||
| # DONE: table structure kept, xmlids renamed to partnership in pre-migration | ||
|
|
||
| ---Fields in module 'website_crm_partner_assign'--- | ||
| website_crm_partner_assign / res.partner / grade_id (many2one) : module is now 'partnership' ('website_crm_partner_assign') | ||
| website_crm_partner_assign / res.partner.grade / _order : module is now 'partnership' ('website_crm_partner_assign') | ||
| website_crm_partner_assign / res.partner.grade / active (boolean) : module is now 'partnership' ('website_crm_partner_assign') | ||
| website_crm_partner_assign / res.partner.grade / display_name (char) : module is now 'partnership' ('website_crm_partner_assign') | ||
| website_crm_partner_assign / res.partner.grade / name (char) : module is now 'partnership' ('website_crm_partner_assign') | ||
| website_crm_partner_assign / res.partner.grade / sequence (integer) : module is now 'partnership' ('website_crm_partner_assign') | ||
| website_crm_partner_assign / res.users / grade_id (many2one) : module is now 'partnership' ('website_crm_partner_assign') | ||
|
|
||
| # DONE: db columns kept, fields moved to partnership | ||
|
|
||
| ---XML records in module 'website_crm_partner_assign'--- | ||
| DEL ir.actions.act_window: website_crm_partner_assign.res_partner_grade_action [renamed to partnership module] | ||
| DEL ir.model.access: website_crm_partner_assign.access_res_partner_grade [renamed to partnership module] | ||
| DEL ir.model.access: website_crm_partner_assign.access_res_partner_grade_employee | ||
| DEL ir.model.access: website_crm_partner_assign.access_res_partner_grade_manager [renamed to partnership module] | ||
| DEL ir.ui.menu: website_crm_partner_assign.crm_menu_resellers | ||
| DEL ir.ui.menu: website_crm_partner_assign.menu_res_partner_grade_action [renamed to partnership module] | ||
| NEW ir.ui.view: website_crm_partner_assign.contact_details | ||
| NEW ir.ui.view: website_crm_partner_assign.index_filter_by_industry | ||
| DEL ir.ui.view: website_crm_partner_assign.res_partner_grade_view_search | ||
| DEL ir.ui.view: website_crm_partner_assign.snippet_options | ||
| DEL ir.ui.view: website_crm_partner_assign.view_partner_grade_tree | ||
| DEL ir.ui.view: website_crm_partner_assign.view_res_partner_filter_assign | ||
| DEL res.partner.grade: website_crm_partner_assign.res_partner_grade_data_bronze [renamed to partnership module] | ||
| DEL res.partner.grade: website_crm_partner_assign.res_partner_grade_data_gold [renamed to partnership module] | ||
| DEL res.partner.grade: website_crm_partner_assign.res_partner_grade_data_silver [renamed to partnership module] | ||
|
|
||
| # DONE: xmlids renamed to partnership in pre-migration |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be done instead in
partnershipmodule pre-migration.