mirror of
https://gitlab.com/flectra-community/account-financial-reporting.git
synced 2024-11-14 17:52:06 +00:00
Automatic Update form OCA2FC Migrator
This commit is contained in:
parent
bab98bc024
commit
2f8d2cf950
@ -16,16 +16,22 @@ def migrate(env, version):
|
|||||||
"""
|
"""
|
||||||
old_move_type_column = "move_type"
|
old_move_type_column = "move_type"
|
||||||
new_move_type_column = "financial_type"
|
new_move_type_column = "financial_type"
|
||||||
|
move_model_name = "account.move"
|
||||||
move_table_name = "account_move"
|
move_table_name = "account_move"
|
||||||
enterprise_move_type_rename = "move_type_custom"
|
enterprise_move_type_rename = "move_type_custom"
|
||||||
ou_move_type_rename = openupgrade.get_legacy_name(old_move_type_column)
|
ou_move_type_rename = openupgrade.get_legacy_name(old_move_type_column)
|
||||||
|
|
||||||
for move_type_rename in (enterprise_move_type_rename, ou_move_type_rename):
|
for move_type_rename in (enterprise_move_type_rename, ou_move_type_rename):
|
||||||
if openupgrade.column_exists(env.cr, move_table_name, move_type_rename):
|
if openupgrade.column_exists(env.cr, move_table_name, move_type_rename):
|
||||||
openupgrade.rename_columns(
|
openupgrade.rename_fields(
|
||||||
env.cr,
|
env,
|
||||||
{
|
[
|
||||||
move_table_name: [(move_type_rename, new_move_type_column)],
|
(
|
||||||
},
|
move_model_name,
|
||||||
|
move_table_name,
|
||||||
|
move_type_rename,
|
||||||
|
new_move_type_column,
|
||||||
|
),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user