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
17 changes: 17 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 @@ -39,6 +39,7 @@
("account.payment", "memo", "char"),
("account.payment", "state", "selection"),
("account.payment", "is_sent", "boolean"),
("account.move", "made_sequence_gap", "boolean", True),
]


Expand Down Expand Up @@ -197,6 +198,21 @@ def fill_statement_line_fields(env):
)


def fill_account_move_made_sequence_gap(env):
openupgrade.logged_query(
env.cr,
"""
UPDATE account_move am
SET made_sequence_gap = False
FROM account_move am2
WHERE am.journal_id = am2.journal_id
AND am.sequence_prefix = am2.sequence_prefix
AND am.sequence_number = am2.sequence_number + 1
AND am.sequence_number > 1
""",
)


@openupgrade.migrate()
def migrate(env, version):
if openupgrade.column_exists(env.cr, "account_cash_rounding", "profit_account_id"):
Expand Down Expand Up @@ -249,3 +265,4 @@ def migrate(env, version):
"account.action_account_unreconcile",
],
)
fill_account_move_made_sequence_gap(env)
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ account / account.move / journal_group_id (many2one) : NEW re
# NOTHING TO DO: store = False

account / account.move / made_sequence_gap (boolean) : NEW isfunction: function, stored
# NOTHING TO DO: will be computed by ORM
# NOTHING TO DO: Created and filled pre-migration

account / account.move / origin_payment_id (many2one) : NEW relation: account.payment
account / account.move / payment_id (many2one) : DEL relation: account.payment
Expand Down