Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions openupgrade_scripts/scripts/account/18.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,22 @@ def fill_account_payment(env):

@openupgrade.migrate()
def migrate(env, version):
if openupgrade.column_exists(env.cr, "account_cash_rounding", "profit_account_id"):
# in v13, these fields were not company_dependent
field_names = ["profit_account_id"]
if openupgrade.column_exists(
env.cr, "account_cash_rounding", "loss_account_id"
):
# loss_account_id came from pos_cash_rounding
field_names += ["loss_account_id"]
openupgrade.rename_columns(
env.cr,
{
"account_cash_rounding": [
(field_name, None) for field_name in field_names
]
},
)
if openupgrade.column_exists(
env.cr, "account_move", "l10n_dk_currency_rate_at_transaction"
):
Expand Down
6 changes: 6 additions & 0 deletions openupgrade_scripts/scripts/stock/18.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ def fill_stock_putaway_rule_sublocation(env):

@openupgrade.migrate()
def migrate(env, version=None):
if openupgrade.column_exists(env.cr, "product_template", "responsible_id"):
# in v12, this field was not company_dependent
openupgrade.rename_columns(
env.cr,
{"product_template": [("responsible_id", None)]},
)
openupgrade.copy_columns(env.cr, _columns_copy)
openupgrade.rename_fields(env, _field_renames)
openupgrade.rename_xmlids(env.cr, _xmlid_renames)
Expand Down