Skip to content

Commit

Permalink
Merge pull request #3051 from tranngocson1996/v14_mig_crm_iap_lead
Browse files Browse the repository at this point in the history
[MIG][14.0] crm_iap_lead: Migration script
  • Loading branch information
pedrobaeza authored Jan 7, 2022
2 parents 43da0ef + 1c53975 commit 17dbdfc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
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

0 comments on commit 17dbdfc

Please sign in to comment.