From 165138624e9f8dceafd7e7cfe419381e3cfa589d Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 4 Dec 2020 20:31:26 +0100 Subject: [PATCH] [OU] account_payment_order: Transfer reference_type in invoice --- .../migrations/13.0.1.0.0/post-migration.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_payment_order/migrations/13.0.1.0.0/post-migration.py b/account_payment_order/migrations/13.0.1.0.0/post-migration.py index a49b21956..46ba6e927 100644 --- a/account_payment_order/migrations/13.0.1.0.0/post-migration.py +++ b/account_payment_order/migrations/13.0.1.0.0/post-migration.py @@ -9,3 +9,11 @@ def migrate(env, version): openupgrade.load_data( env.cr, "account_payment_order", "migrations/13.0.1.0.0/noupdate_changes.xml" ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_move am + SET reference_type = ai.reference_type + FROM account_invoice ai + WHERE ai.id = am.old_invoice_id""", + )