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

[13.0][MIG] snailmail #2319

Merged
merged 1 commit into from
Feb 16, 2021
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
36 changes: 36 additions & 0 deletions addons/snailmail/migrations/13.0.0.1/openupgrade_analysis_work.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---Models in module 'snailmail'---
new model snailmail.letter.cancel [transient]
new model snailmail.letter.format.error [transient]
new model snailmail.letter.missing.required.fields [transient]
# NOTHING TO DO

---Fields in module 'snailmail'---
snailmail / mail.message / letter_ids (one2many) : NEW relation: snailmail.letter
snailmail / mail.message / message_type (False) : NEW selection_keys: ['comment', 'email', 'notification', 'snailmail', 'user_notification'], mode: modify
snailmail / res.company / snailmail_cover (boolean) : NEW hasdefault
snailmail / snailmail.letter / city (char) : NEW
snailmail / snailmail.letter / country_id (many2one) : NEW relation: res.country
snailmail / snailmail.letter / cover (boolean) : NEW hasdefault
snailmail / snailmail.letter / error_code (selection) : NEW selection_keys: ['CREDIT_ERROR', 'FORMAT_ERROR', 'MISSING_REQUIRED_FIELDS', 'NO_PRICE_AVAILABLE', 'TRIAL_ERROR', 'UNKNOWN_ERROR']
snailmail / snailmail.letter / message_id (many2one) : NEW relation: mail.message
snailmail / snailmail.letter / state_id (many2one) : NEW relation: res.country.state
snailmail / snailmail.letter / street (char) : NEW
snailmail / snailmail.letter / street2 (char) : NEW
snailmail / snailmail.letter / zip (char) : NEW
# NOTHING TO DO (?): new features

snailmail / snailmail.letter / state (selection) : now required, req_default: function
snailmail / snailmail.letter / state (selection) : selection_keys is now '['canceled', 'error', 'pending', 'sent']' ('['canceled', 'draft', 'error', 'pending', 'sent']')
# DONE: post-migration: mapped 'draft' state to 'pending'

---XML records in module 'snailmail'---
NEW ir.actions.act_window: snailmail.snailmail_letter_cancel_action
NEW ir.actions.act_window: snailmail.snailmail_letter_format_error_action
NEW ir.actions.act_window: snailmail.snailmail_letter_missing_required_fields_action
NEW ir.ui.view: snailmail.assets_backend
NEW ir.ui.view: snailmail.qunit_suite
NEW ir.ui.view: snailmail.snailmail_letter_cancel
NEW ir.ui.view: snailmail.snailmail_letter_format_error
NEW ir.ui.view: snailmail.snailmail_letter_missing_required_fields
DEL ir.ui.view: snailmail.res_config_settings_view_form
# NOTHING TO DO
19 changes: 19 additions & 0 deletions addons/snailmail/migrations/13.0.0.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def map_snailmail_letter_state(env):
openupgrade.map_values(
env.cr,
openupgrade.get_legacy_name('state'),
'state',
[('draft', 'pending'),
],
table='snailmail_letter',
)


@openupgrade.migrate()
def migrate(env, version):
map_snailmail_letter_state(env)
14 changes: 14 additions & 0 deletions addons/snailmail/migrations/13.0.0.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

_column_copies = {
'snailmail_letter': [
('state', None, None),
],
}


@openupgrade.migrate()
def migrate(env, version):
openupgrade.copy_columns(env.cr, _column_copies)
pedrobaeza marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules120-130.rst
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ missing in the new release are marked with |del|.
+----------------------------------------------+-------------------------------------------------+
|sms | |
+----------------------------------------------+-------------------------------------------------+
|snailmail | |
|snailmail | Done |
+----------------------------------------------+-------------------------------------------------+
|snailmail_account | |
+----------------------------------------------+-------------------------------------------------+
Expand Down