[FIX] account: fix lockdates in sequence holes

The lockdate date should not be included in the check
for sequence holes, as it is supposed to be locked

Task-3280680

X-original-commit: 18573b7c47f19933e6a420f8bb8d72687b568a5b
Part-of: odoo/odoo#119427
This commit is contained in:
Julien Alardot (jual)
2023-04-22 06:53:54 +02:00
parent a2350508b1
commit 1fddf0d02d
2 changed files with 1 additions and 2 deletions
@@ -106,7 +106,7 @@ class account_journal(models.Model):
JOIN res_company company ON company.id = move.company_id
WHERE move.journal_id = ANY(%(journal_ids)s)
AND move.state = 'posted'
AND (company.fiscalyear_lock_date IS NULL OR move.date >= company.fiscalyear_lock_date)
AND (company.fiscalyear_lock_date IS NULL OR move.date > company.fiscalyear_lock_date)
GROUP BY move.journal_id, move.sequence_prefix
HAVING COUNT(*) != MAX(move.sequence_number) - MIN(move.sequence_number) + 1
""", {
-1
View File
@@ -770,7 +770,6 @@ class AccountMove(models.Model):
AND this.sequence_number != 1
AND this.name != '/'
AND this.id = ANY(%(move_ids)s)
AND (company.fiscalyear_lock_date IS NULL OR this.date >= company.fiscalyear_lock_date)
""", {
'move_ids': self.ids,
})