[OU] account_banking_mandate: Transfer mandate in invoices

This commit is contained in:
Pedro M. Baeza
2020-12-04 19:58:15 +01:00
committed by Stefan Rijnhart
parent 9797b67274
commit 3dd763efe5

View File

@@ -9,3 +9,11 @@ def migrate(env, version):
openupgrade.load_data(
env.cr, "account_banking_mandate", "migrations/13.0.1.0.0/noupdate_changes.xml"
)
openupgrade.logged_query(
env.cr,
"""
UPDATE account_move am
SET mandate_id = ai.mandate_id
FROM account_invoice ai
WHERE ai.id = am.old_invoice_id""",
)