mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[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:
@@ -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"),
|
||||
]
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user