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

[17.0][OU-ADD] mass_mailing: Migration to 17.0 #4671

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "mass_mailing", "17.0.2.7/noupdate_changes.xml")
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/mass_mailing/17.0.2.7/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.delete_sql_constraint_safely(
env,
"mass_mailing",
"mailing_contact_list_rel",
"unique_contact_list",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---Models in module 'mass_mailing'---
obsolete model mailing.contact.subscription
new model mailing.subscription
new model mailing.subscription.optout
# NOTHING TO DO:

---Fields in module 'mass_mailing'---
mass_mailing / mail.blacklist / opt_out_reason_id (many2one) : NEW relation: mailing.subscription.optout
mass_mailing / mailing.contact / _order : _order is now 'name ASC, id DESC' ('email')
mass_mailing / mailing.contact / list_ids (many2many) : table is now 'mailing_subscription' ('mailing_contact_list_rel')
mass_mailing / mailing.contact / message_main_attachment_id (many2one): DEL relation: ir.attachment
mass_mailing / mailing.contact / rating_ids (one2many) : NEW relation: rating.rating
mass_mailing / mailing.contact / subscription_ids (one2many) : NEW relation: mailing.subscription
mass_mailing / mailing.contact / subscription_list_ids (one2many): DEL relation: mailing.contact.subscription

mass_mailing / mailing.contact.subscription / contact_id (many2one) : DEL relation: mailing.contact, required
mass_mailing / mailing.contact.subscription / list_id (many2one) : DEL relation: mailing.list, required
mass_mailing / mailing.contact.subscription / opt_out (boolean) : DEL
mass_mailing / mailing.contact.subscription / unsubscription_date (datetime): DEL
# NOTHING TO DO:

mass_mailing / mailing.list / contact_ids (many2many) : table is now 'mailing_subscription' ('mailing_contact_list_rel')
mass_mailing / mailing.list / subscription_ids (one2many) : relation is now 'mailing.subscription' ('mailing.contact.subscription') [nothing to do]
# NOTHING TO DO:

mass_mailing / mailing.mailing / ab_testing_completed (boolean): not stored anymore
mass_mailing / mailing.mailing / activity_user_id (many2one) : not related anymore
mass_mailing / mailing.mailing / activity_user_id (many2one) : now a function
mass_mailing / mailing.mailing / bounced_ratio (integer) : type is now 'float' ('integer')
mass_mailing / mailing.mailing / clicks_ratio (integer) : type is now 'float' ('integer')
mass_mailing / mailing.mailing / message_main_attachment_id (many2one): DEL relation: ir.attachment
mass_mailing / mailing.mailing / opened_ratio (integer) : type is now 'float' ('integer')
mass_mailing / mailing.mailing / rating_ids (one2many) : NEW relation: rating.rating
mass_mailing / mailing.mailing / received_ratio (integer) : type is now 'float' ('integer')
mass_mailing / mailing.mailing / replied_ratio (integer) : type is now 'float' ('integer')
mass_mailing / mailing.mailing / schedule_date (datetime) : not a function anymore

mass_mailing / mailing.subscription / contact_id (many2one) : NEW relation: mailing.contact, required
mass_mailing / mailing.subscription / list_id (many2one) : NEW relation: mailing.list, required
mass_mailing / mailing.subscription / opt_out (boolean) : NEW hasdefault: default
mass_mailing / mailing.subscription / opt_out_datetime (datetime) : NEW hasdefault: compute
mass_mailing / mailing.subscription / opt_out_reason_id (many2one) : NEW relation: mailing.subscription.optout
# NOTHING TO DO: new feature

mass_mailing / mailing.subscription.optout / is_feedback (boolean) : NEW
mass_mailing / mailing.subscription.optout / name (char) : NEW
mass_mailing / mailing.subscription.optout / sequence (integer) : NEW hasdefault: default
# NOTHING TO DO: new feature

mass_mailing / mailing.trace / failure_reason (text) : NEW
mass_mailing / mailing.trace / failure_type (selection) : selection_keys is now '['mail_bl', 'mail_bounce', 'mail_dup', 'mail_email_invalid', 'mail_email_missing', 'mail_from_invalid', 'mail_from_missing', 'mail_optout', 'mail_smtp', 'unknown']' ('['mail_bl', 'mail_dup', 'mail_email_invalid', 'mail_email_missing', 'mail_optout', 'mail_smtp', 'unknown']')
mass_mailing / mailing.trace / trace_status (selection) : selection_keys is now '['bounce', 'cancel', 'error', 'open', 'outgoing', 'pending', 'process', 'reply', 'sent']' ('['bounce', 'cancel', 'error', 'open', 'outgoing', 'reply', 'sent']')
# NOTHING TO DO: new feature

mass_mailing / utm.campaign / ab_testing_completed (boolean): now a function
mass_mailing / utm.campaign / ab_testing_total_pc (integer) : DEL
mass_mailing / utm.campaign / ab_testing_winner_mailing_id (many2one): NEW relation: mailing.mailing
mass_mailing / utm.campaign / bounced_ratio (integer) : type is now 'float' ('integer')
mass_mailing / utm.campaign / opened_ratio (integer) : type is now 'float' ('integer')
mass_mailing / utm.campaign / received_ratio (integer) : type is now 'float' ('integer')
mass_mailing / utm.campaign / replied_ratio (integer) : type is now 'float' ('integer')

---XML records in module 'mass_mailing'---
NEW ir.actions.act_window: mass_mailing.mailing_subscription_action_report_optout
NEW ir.actions.act_window: mass_mailing.mailing_subscription_optout_action
# NOTHING TO DO

NEW ir.model.access: mass_mailing.access_mailing_subscription_mm_user
NEW ir.model.access: mass_mailing.access_mailing_subscription_optout_mm_user
DEL ir.model.access: mass_mailing.access_mailing_contact_subscription_mm_user
# NOTHING TO DO

NEW ir.model.constraint: mass_mailing.constraint_mailing_subscription_unique_contact_list
# NOTHING TO DO: new feature

DEL ir.model.constraint: mass_mailing.constraint_mailing_contact_list_rel_unique_contact_list
# DONE: pre-migration: remove constraint safely

NEW ir.ui.menu: mass_mailing.mailing_menu_report_mailing
NEW ir.ui.menu: mass_mailing.mailing_menu_report_subscribe_reason
NEW ir.ui.menu: mass_mailing.mailing_subscription_optout_menu
# NOTHING TO DO

NEW ir.ui.view: mass_mailing.mail_blacklist_view_form
NEW ir.ui.view: mass_mailing.mail_blacklist_view_search
NEW ir.ui.view: mass_mailing.mail_blacklist_view_tree
NEW ir.ui.view: mass_mailing.mailing_subscription_optout_view_form
NEW ir.ui.view: mass_mailing.mailing_subscription_optout_view_search
NEW ir.ui.view: mass_mailing.mailing_subscription_optout_view_tree
NEW ir.ui.view: mass_mailing.mailing_subscription_view_form
NEW ir.ui.view: mass_mailing.mailing_subscription_view_search
NEW ir.ui.view: mass_mailing.mailing_subscription_view_tree
NEW ir.ui.view: mass_mailing.mailing_view
NEW ir.ui.view: mass_mailing.page_mailing_unsubscribe
NEW ir.ui.view: mass_mailing.preview_content_mobile
NEW ir.ui.view: mass_mailing.unsubscribe_form
DEL ir.ui.view: mass_mailing.iframe_css_assets_edit
DEL ir.ui.view: mass_mailing.iframe_css_assets_readonly
DEL ir.ui.view: mass_mailing.mailing_contact_subscription_view_form
DEL ir.ui.view: mass_mailing.mailing_contact_subscription_view_search
DEL ir.ui.view: mass_mailing.mailing_contact_subscription_view_tree
DEL ir.ui.view: mass_mailing.mass_mailing_mail_style (noupdate)
DEL ir.ui.view: mass_mailing.page_unsubscribe
DEL ir.ui.view: mass_mailing.page_unsubscribed
DEL ir.ui.view: mass_mailing.snippet_options_extra_shapes
DEL ir.ui.view: mass_mailing.snippet_options_image_styles
DEL ir.ui.view: mass_mailing.unsubscribe
DEL ir.ui.view: mass_mailing.unsubscribed
DEL ir.ui.view: mass_mailing.view
# NOTHING TO DO

NEW mailing.contact: mass_mailing.mass_mail_contact_0 (noupdate)
DEL mailing.contact: mass_mailing.mass_mailing_contact_0 (noupdate)
# NOTHING TO DO

NEW mailing.subscription: mass_mailing.mailing_list_data_sub_contact_0 (noupdate)
NEW mailing.subscription.optout: mass_mailing.mailing_subscription_optout_data_0
NEW mailing.subscription.optout: mass_mailing.mailing_subscription_optout_data_1
NEW mailing.subscription.optout: mass_mailing.mailing_subscription_optout_data_2
NEW mailing.subscription.optout: mass_mailing.mailing_subscription_optout_data_3
NEW mailing.subscription.optout: mass_mailing.mailing_subscription_optout_data_4
# NOTHING TO DO new data
Loading