Skip to content

Commit

Permalink
[OU-FIX] disable fiscalyear_lock_date check
Browse files Browse the repository at this point in the history
fiscalyear_lock_date check prevent modifying old move, but some field
should be recomputed to be correct in 15.0.
  • Loading branch information
remytms authored and huguesdk committed Dec 20, 2024
1 parent 3bba746 commit ab1834d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def _fill_payment_state(env):
aat.type = 'payable'
""",
)
# Disable fiscalyear_lock_date check
_check_fiscalyear_lock_date = env[
"account.move"
].__class__._check_fiscalyear_lock_date
env["account.move"].__class__._check_fiscalyear_lock_date = lambda self: None
# Recompute several fields (always_tax_exigible, amount_residual,
# amount_residual_signed, amount_untaxed, amount_untaxed_signed,
# payment_state) for the moves associated to the expenses, as on v14 these
Expand All @@ -34,6 +39,10 @@ def _fill_payment_state(env):
env["account.move"].with_context(active_test=False, tracking_disable=True).search(
[("line_ids.expense_id", "!=", False)]
)._compute_amount()
# Enable fiscalyear_lock_date check
env[
"account.move"
].__class__._check_fiscalyear_lock_date = _check_fiscalyear_lock_date


@openupgrade.migrate()
Expand Down

0 comments on commit ab1834d

Please sign in to comment.