From 7720c5d3bf7fda2b3790d339a552f55ae07132d0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 30 Aug 2021 09:50:08 +0200 Subject: [PATCH] [OU-FIX] account_payment_partner: Pre-create payment_mode_id So the compute method is not triggered (it will be filled later by post-migration script). --- .../migrations/13.0.1.0.0/pre-migration.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 account_payment_partner/migrations/13.0.1.0.0/pre-migration.py diff --git a/account_payment_partner/migrations/13.0.1.0.0/pre-migration.py b/account_payment_partner/migrations/13.0.1.0.0/pre-migration.py new file mode 100644 index 000000000..38f618e0c --- /dev/null +++ b/account_payment_partner/migrations/13.0.1.0.0/pre-migration.py @@ -0,0 +1,12 @@ +# Copyright 2021 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade # pylint: disable=W7936 + + +@openupgrade.migrate() +def migrate(env, version): + # Pre-create column for avoiding to trigger the compute + openupgrade.logged_query( + env.cr, "ALTER TABLE account_move ADD payment_mode_id int4" + )