From 0a24b2a0037fd32f8e439d9b1f4834c0ff7c4446 Mon Sep 17 00:00:00 2001 From: "Hbto [ Vauxoo ]" Date: Fri, 23 May 2025 17:34:30 +0000 Subject: [PATCH] [FIX] account: use today's date for CABA reverse moves when skip_unlink_of_apr context is set When the `skip_unlink_of_apr` context key is active, reverse cash basis (CABA) journal entries are now created using today's date instead of the original move date. This ensures consistency in cash basis reporting when unlinking reconciliations is intentionally bypassed. --- addons/account/models/account_move.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d0c2bed592342..be70374dbba27 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1820,7 +1820,9 @@ def unlink(self): full_to_unlink |= rec.full_reconcile_id #reverse the tax basis move created at the reconciliation time for move in self.env['account.move'].search([('tax_cash_basis_rec_id', 'in', self._ids)]): - if move.date > (move.company_id.period_lock_date or date.min): + if self._context.get("skip_unlink_of_apr"): + move.reverse_moves(date=fields.Date.today()) + elif move.date > (move.company_id.period_lock_date or date.min): move.reverse_moves(date=move.date) else: move.reverse_moves()