Skip to content
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
2 changes: 1 addition & 1 deletion docsource/modules180-190.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| account_payment |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| account_peppol | | |
| account_peppol |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| |new| account_peppol_advanced_fields | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from openupgradelib import openupgrade

_renamed_models = [("account_peppol.service.wizard", "peppol.config.wizard")]
_renamed_tables = [("account_peppol_service_wizard", "peppol_config_wizard")]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_models(env.cr, _renamed_models)
openupgrade.rename_tables(env.cr, _renamed_tables)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from odoo.tests import TransactionCase

from odoo.addons.openupgrade_framework import openupgrade_test


@openupgrade_test
class TestAccountPeppolMigration(TransactionCase):
def test_wizard_model_renamed(self):
"""account_peppol.service.wizard (transient) renamed to
peppol.config.wizard. rename_models + rename_tables in pre-migration
keeps ir_model / ir_model_data consistent.
"""
self.assertIn("peppol.config.wizard", self.env.registry)
self.assertNotIn("account_peppol.service.wizard", self.env.registry)

def test_wizard_table_renamed(self):
"""The postgres table for the renamed transient model must exist
under the new name (transients have tables even though rows are
cleared periodically).
"""
self.env.cr.execute(
"""
SELECT 1 FROM information_schema.tables
WHERE table_name = 'peppol_config_wizard'
"""
)
self.assertTrue(self.env.cr.fetchone())
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---Models in module 'account_peppol'---
obsolete model account_peppol.service.wizard (renamed to peppol.config.wizard) [transient]
new model peppol.config.wizard (renamed from account_peppol.service.wizard) [transient]

# DONE: pre-migration: rename_models + rename_tables (transient wizard)

---Fields in module 'account_peppol'---
account_peppol / account_edi_proxy_client.user / peppol_verification_code (char): DEL
account_peppol / res.company / account_peppol_proxy_state (selection): selection_keys removed: [in_verification]
account_peppol / res.company / peppol_activate_self_billing_sending (boolean): NEW
account_peppol / res.company / peppol_external_provider (char): NEW
account_peppol / res.company / peppol_metadata (json) : NEW
account_peppol / res.company / peppol_metadata_updated_at (datetime): NEW
account_peppol / res.company / peppol_self_billing_reception_journal_id (many2one): NEW relation: account.journal, isfunction: function, stored
account_peppol_selfbilling / account.journal / is_self_billing (boolean) : module is now 'account' ('account_peppol_selfbilling')

# NOTHING TO DO

---XML records in module 'account_peppol'---
NEW ir.actions.client: account_peppol.action_peppol_auth_callback
NEW ir.cron: account_peppol.ir_cron_peppol_webhook_keepalive
NEW ir.model.access: account_peppol.access_peppol_config_wizard
DEL ir.model.access: account_peppol.account_peppol_service_wizard_system
NEW ir.ui.view: account_peppol.peppol_config_wizard_form
NEW ir.ui.view: account_peppol.portal_my_details
DEL ir.ui.view: account_peppol.account_journal_dashboard_kanban_view
DEL ir.ui.view: account_peppol.peppol_service_configuration
DEL ir.ui.view: account_peppol.portal_my_details_fields
DEL ir.ui.view: account_peppol_selfbilling.account_move_form_inherit_self_billing
DEL ir.ui.view: account_peppol_selfbilling.report_invoice_document
DEL ir.ui.view: account_peppol_selfbilling.view_account_journal_form_inherited
NEW mail.template: account_peppol.mail_template_peppol_registration
DEL mail.template: account_peppol_selfbilling.email_template_edi_self_billing_credit_note [renamed to account module] (noupdate)
DEL mail.template: account_peppol_selfbilling.email_template_edi_self_billing_invoice [renamed to account module] (noupdate)

# NOTHING TO DO
Loading