[OU-ADD] account_credit_control: Rename m2m table and fields

Till v9, old field attributes `rel`, `col1` and `col2` were being
applied to the m2m table. As in v10, old ORM is totally removed, now
we need to put `relation`, `column1` and `column2` attributes for
customizing the m2m relation table.

As no customization, standard names apply, so we need to do the
renamings according to this.
This commit is contained in:
Pedro M. Baeza
2021-10-28 09:57:54 +02:00
parent 1c64e6d847
commit aa5ef85f04

View File

@@ -0,0 +1,21 @@
# Copyright 2021 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_tables(
env.cr, [(
"credit_run_policy_rel",
"credit_control_policy_credit_control_run_rel"
)]
)
openupgrade.rename_columns(
env.cr, {
"credit_control_policy_credit_control_run_rel": [
("run_id", "credit_control_run_id", ),
("policy_id", "credit_control_policy_id"),
]
}
)