Skip to content

Commit

Permalink
Merge PR #3593 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed Jan 23, 2025
2 parents be49e28 + c629617 commit 02570b9
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,18 @@ def migrate(env, version):
if not version:
return

# Verifica se já houve migração, banco de dados migrados na v14
payment_mode_migrated = env["account.payment.mode"].search(
[
("sending_code_id", "!=", False),
],
limit=1,
)
if "sending_code_id" in env["account.payment.mode"]._fields:
# Caso o campo ainda exista,
# checamos se já há registros (indicando migração prévia).
payment_mode_migrated = env["account.payment.mode"].search(
[("sending_code_id", "!=", False)],
limit=1,
)
else:
# Caso o campo não exista,
# assumimos que a migração já foi suficientemente avançada.
payment_mode_migrated = True

if payment_mode_migrated:
return

Expand Down

0 comments on commit 02570b9

Please sign in to comment.