-
-
Notifications
You must be signed in to change notification settings - Fork 695
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 #2319 from ForgeFlow/13.0-mig-snailmail-script
[13.0][MIG] snailmail
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
addons/snailmail/migrations/13.0.0.1/openupgrade_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,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 |
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,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) |
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 @@ | ||
# 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) |
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