diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 7ad166b12e1..67ec719a655 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1884,8 +1884,11 @@ class AccountPartialReconcile(models.Model): if rec.full_reconcile_id: full_to_unlink |= rec.full_reconcile_id #reverse the tax basis move created at the reconciliation time - move = self.env['account.move'].search([('tax_cash_basis_rec_id', 'in', self._ids)]) - move.reverse_moves() + 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 '0000-00-00'): + move.reverse_moves(date=move.date) + else: + move.reverse_moves() res = super(AccountPartialReconcile, self).unlink() if full_to_unlink: full_to_unlink.unlink()