-
-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3502 from ForgeFlow/v15_mig_crm
[15.0][MIG] crm: migration script
- Loading branch information
Showing
4 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
17 changes: 17 additions & 0 deletions
17
openupgrade_scripts/scripts/crm/15.0.1.6/post-migration.py
This file contains 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,17 @@ | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def try_delete_noupdate_records(env): | ||
openupgrade.delete_records_safely_by_xml_id( | ||
env, | ||
[ | ||
"crm.mail_alias_lead_info", | ||
"crm.email_template_opportunity_mail", | ||
], | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.load_data(env.cr, "crm", "15.0.1.6/noupdate_changes.xml") | ||
try_delete_noupdate_records(env) |
This file contains 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,14 @@ | ||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.convert_field_to_html(env.cr, "crm_lead", "description", "description") | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
ALTER TABLE crm_team_member | ||
ADD COLUMN assignment_max INTEGER DEFAULT 30; | ||
ALTER TABLE crm_team_member ALTER COLUMN assignment_max DROP DEFAULT; | ||
""", | ||
) |
70 changes: 70 additions & 0 deletions
70
openupgrade_scripts/scripts/crm/15.0.1.6/upgrade_analysis_work.txt
This file contains 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,70 @@ | ||
---Models in module 'crm'--- | ||
new model crm.lead.pls.update [transient] | ||
# NOTHING TO DO | ||
|
||
---Fields in module 'crm'--- | ||
crm / crm.lead / calendar_event_ids (one2many) : NEW relation: calendar.event | ||
crm / crm.lead / company_currency (many2one) : not related anymore | ||
crm / crm.lead / company_currency (many2one) : now a function | ||
crm / crm.lead / company_id (many2one) : now a function | ||
# NOTHING TO DO: Handle by ORM | ||
|
||
crm / crm.lead / description (text) : type is now 'html' ('text') | ||
# DONE: pre-migration: convert text to html | ||
|
||
crm / crm.team / assignment_domain (char) : NEW | ||
crm / crm.team / assignment_optout (boolean) : NEW | ||
crm / crm.team.member / assignment_domain (char) : NEW | ||
# NOTHING TO DO: new feature | ||
|
||
crm / crm.team.member / assignment_max (integer) : NEW hasdefault | ||
# DONE: pre-migration: create and set default value for column 'assignment_max' is 30 | ||
|
||
crm / crm.team.member / assignment_optout (boolean) : NEW | ||
crm / res.partner / meeting_count (integer) : module is now 'calendar' ('crm') | ||
crm / res.partner / meeting_ids (many2many) : module is now 'calendar' ('crm') | ||
crm / res.users / meeting_count (integer) : module is now 'calendar' ('crm') | ||
crm / res.users / meeting_ids (many2many) : module is now 'calendar' ('crm') | ||
# NOTHING TO DO: Handle by ORM | ||
|
||
---XML records in module 'crm'--- | ||
NEW crm.lead.scoring.frequency.field: crm.frequency_field_tag_ids (noupdate) | ||
NEW ir.actions.act_window: crm.action_lead_mail_compose | ||
NEW ir.actions.act_window: crm.crm_lead_action_forecast | ||
NEW ir.actions.act_window: crm.crm_lead_action_open_lead_form | ||
NEW ir.actions.act_window: crm.crm_lead_pls_update_action | ||
DEL ir.actions.act_window: crm.crm_lead_act_window_compose | ||
NEW ir.actions.act_window.view: crm.action_report_crm_lead_salesteam_view_graph | ||
NEW ir.actions.act_window.view: crm.action_report_crm_lead_salesteam_view_pivot | ||
NEW ir.actions.act_window.view: crm.action_report_crm_lead_salesteam_view_tree | ||
NEW ir.actions.act_window.view: crm.crm_lead_action_forecast_view_graph | ||
NEW ir.actions.act_window.view: crm.crm_lead_action_forecast_view_kanban | ||
NEW ir.actions.act_window.view: crm.crm_lead_action_forecast_view_pivot | ||
NEW ir.actions.act_window.view: crm.crm_lead_action_forecast_view_tree | ||
NEW ir.actions.server: crm.action_opportunity_forecast | ||
NEW ir.cron: crm.ir_cron_crm_lead_assign (noupdate) | ||
NEW ir.model.access: crm.crm_lead_pls_update_access_system | ||
DEL ir.model.access: crm.access_crm_lead_partner_manager | ||
NEW ir.ui.menu: crm.crm_menu_forecast | ||
NEW ir.ui.menu: crm.crm_team_member_config | ||
NEW ir.ui.view: crm.crm_action_helper | ||
NEW ir.ui.view: crm.crm_lead_pls_update_view_form | ||
NEW ir.ui.view: crm.crm_lead_view_graph_forecast | ||
NEW ir.ui.view: crm.crm_lead_view_kanban_forecast | ||
NEW ir.ui.view: crm.crm_lead_view_pivot_forecast | ||
NEW ir.ui.view: crm.crm_lead_view_search_forecast | ||
NEW ir.ui.view: crm.crm_lead_view_tree_forecast | ||
NEW ir.ui.view: crm.crm_team_member_view_form | ||
NEW ir.ui.view: crm.crm_team_member_view_kanban | ||
NEW ir.ui.view: crm.crm_team_member_view_tree | ||
NEW ir.ui.view: crm.crm_team_view_kanban_dashboard | ||
NEW ir.ui.view: crm.crm_team_view_tree | ||
DEL ir.ui.view: crm.assets_backend | ||
DEL ir.ui.view: crm.assets_tests | ||
DEL ir.ui.view: crm.crm_team_salesteams_view_kanban | ||
DEL ir.ui.view: crm.qunit_suite | ||
# NOTHING TO DO | ||
|
||
DEL mail.alias: crm.mail_alias_lead_info (noupdate) | ||
DEL mail.template: crm.email_template_opportunity_mail (noupdate) | ||
# DONE: post-migration: safely deleted xmlids |