The Problem
You try to post an invoice, register a payment, or create a journal entry and Odoo blocks it with: You cannot add/modify entries prior to and inclusive of the lock date. This is not a bug — lock dates are an accounting control feature — but it becomes a problem when you need to make legitimate corrections to a locked period.
Error Messages
# Common variations:
UserError: You cannot add/modify entries prior to and inclusive of the lock date Dec 31, 2025.
UserError: You cannot add/modify entries prior to and inclusive of the lock date Dec 31, 2025. Check the company settings or ask someone with the 'Adviser' role.
ValidationError: The operation is not allowed. The lock date has been set.What Are Lock Dates in Odoo?
Odoo has three types of lock dates:
| Lock Date Type | Who It Blocks | Purpose |
|---|---|---|
| Lock Date for Non-Advisers | Regular accountants | Prevent modifications while advisers still can |
| Lock Date for All Users | Everyone including advisers | Hard lock after period is finalized |
| Tax Lock Date | Everyone | Prevent changes affecting tax returns |
Any entry dated on or before the lock date is blocked. This prevents accidental modifications to closed accounting periods.
When You Legitimately Need to Bypass Lock Dates
- Late vendor bills arriving after period close
- Audit adjustments required by external auditors
- Correcting an error discovered after period close
- Year-end adjustments by the accounting firm
How to Fix / Work Around
1. Move the Lock Date (If You Have Permission)
The most straightforward fix. Temporarily move the lock date, make your entry, then restore it.
Steps:
- Go to Accounting > Configuration > Settings
- Scroll to "Fiscal Periods" section
- Change the appropriate lock date to before your entry's date
- Save
- Post your entry
- Set the lock date back
Who can do this: Only users with the "Adviser" role can change the "Lock Date for Non-Advisers". The "Lock Date for All Users" can only be changed by the Adviser role or users with accounting admin rights.
2. Post-Date the Entry
Instead of modifying the locked period, create the entry with a date in the current open period.
# Instead of posting a bill dated December 15 (locked period):
# Post it with today's date in the current period
# The entry reflects the correct amount in the current periodThis is the recommended approach for late vendor bills — use the current period date, not the original document date.
3. Use the Adviser Role
The "Lock Date for Non-Advisers" only blocks regular users. Users with the Adviser role can still post entries in the locked period.
Fix: Go to Settings > Users > select the user > set Accounting role to "Adviser".
Note: Only grant Adviser role to senior accountants who understand the implications of posting to closed periods.
4. Tax Lock Date vs. Accounting Lock Date
The tax lock date and accounting lock date are separate. You might be able to post a regular entry but not one that affects tax amounts.
Check: Accounting > Configuration > Settings. Verify both lock dates. The tax lock date may be set even if the accounting lock date is not (or vice versa).
5. Fix via SQL (Last Resort)
If you are locked out and cannot access settings (e.g., the only Adviser user is deactivated):
-- Check current lock dates:
SELECT id, name,
period_lock_date, -- lock for non-advisers
fiscalyear_lock_date, -- lock for all users
tax_lock_date -- tax lock
FROM res_company;
-- Temporarily remove lock date (BE VERY CAREFUL):
UPDATE res_company
SET fiscalyear_lock_date = NULL,
period_lock_date = NULL
WHERE id = 1;
-- After making your entry, set it back:
UPDATE res_company
SET fiscalyear_lock_date = '2025-12-31',
period_lock_date = '2025-12-31'
WHERE id = 1;This bypasses all Odoo validation. Only use this when no other option exists, and always restore the lock dates immediately.
Lock Date Best Practices
Monthly Close Workflow
- Complete all entries for the month
- Run reconciliation and checks
- Set "Lock Date for Non-Advisers" to the last day of the month
- Allow advisers time for final adjustments
- Set "Lock Date for All Users" after all adjustments are done
- Set Tax Lock Date after tax return is filed
Year-End Close
- Complete year-end adjustments
- Generate financial statements
- Have external auditor review
- Make any audit adjustments (adviser role)
- Set all lock dates to fiscal year end
- Run year-end closing entry (Odoo does this automatically)
Multi-Company Lock Dates
Lock dates are per-company. In a multi-company setup, each company can have different lock dates. Ensure you are checking the lock date for the correct company:
# Check lock dates for all companies:
SELECT c.name, c.period_lock_date, c.fiscalyear_lock_date, c.tax_lock_date
FROM res_company c
ORDER BY c.name;Common Mistakes
- Setting lock date too aggressively: Wait until all expected entries are posted before locking
- Forgetting tax lock date: Filing a tax return but not setting the tax lock date allows modifications that could invalidate the filing
- Not documenting lock date changes: Keep a log of when lock dates were temporarily changed and why
- Locking before bank reconciliation: Complete bank statement import and reconciliation before setting the lock date
Audit Trail
When you do modify entries in a previously locked period, Odoo's chatter log records the changes. Additionally, consider:
- Adding a note explaining why the lock date was changed
- Documenting the entry that required the change
- Having the change approved by a supervisor