Skip to content
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

[MIG][14.0] crm_iap_lead: Migration script #3051

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsource/modules130-140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|crm | Done |
+--------------------------------------------+-------------------------------------------------+
|crm_iap_lead | |
|crm_iap_lead | Done |
+--------------------------------------------+-------------------------------------------------+
|crm_iap_lead_enrich | |
+--------------------------------------------+-------------------------------------------------+
Expand Down
27 changes: 27 additions & 0 deletions openupgrade_scripts/scripts/crm_iap_lead/14.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from openupgradelib import openupgrade


def m2m_columns_and_tables_renamed(env):
openupgrade.rename_columns(
env.cr,
{
"crm_iap_lead_mining_request_crm_lead_tag_rel": [
("crm_lead_tag_id", "crm_tag_id")
]
},
)

openupgrade.rename_tables(
env.cr,
[
(
"crm_iap_lead_mining_request_crm_lead_tag_rel",
"crm_iap_lead_mining_request_crm_tag_rel",
)
],
)


@openupgrade.migrate()
def migrate(env, version):
m2m_columns_and_tables_renamed(env)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---Models in module 'crm_iap_lead'---
---Fields in module 'crm_iap_lead'---
crm_iap_lead / crm.iap.lead.mining.request / tag_ids (many2many) : column2 is now 'crm_tag_id' ('crm_lead_tag_id') [crm_iap_lead_mining_request_crm_lead_tag_rel]
crm_iap_lead / crm.iap.lead.mining.request / tag_ids (many2many) : relation is now 'crm.tag' ('crm.lead.tag') [nothing to do]
crm_iap_lead / crm.iap.lead.mining.request / tag_ids (many2many) : table is now 'crm_iap_lead_mining_request_crm_tag_rel' ('crm_iap_lead_mining_request_crm_lead_tag_rel')
# DONE: pre-migration: renamed tables and columns

crm_iap_lead / crm.iap.lead.mining.request / team_id (many2one) : now a function
# NOTHING TO DO: automated field filling

crm_iap_lead / crm.lead / reveal_id (char) : module is now 'iap_crm' ('crm_iap_lead')
# NOTHING TO DO: the crm_iap_lead module depends on iap_crm module

---XML records in module 'crm_iap_lead'---
NEW ir.ui.view: crm_iap_lead.enrich_company
DEL ir.ui.view: crm_iap_lead.lead_message_template
# NOTHING TO DO: noupdate="0" records