Hello Odoo Community,
I'm developing a custom module in Odoo 17 and need invoice and credit note sequences to reset monthly. However, the sequences aren't resetting as expected. Here's a brief overview of the issue:
Problem
Even with use_date_range=True, the sequences do not reset monthly. Instead, a single date range is created for the entire year (2024-01-01 to 2024-12-31), and the sequence continues incrementing without resetting each month.
What I've Checked
- Sequence Configuration: Confirmed use_date_range=True is set, and the prefixes include both year and month.
- Database Records: The ir_sequence_date_range table shows a single range for the entire year instead of separate monthly ranges.
- Context Handling: I'm passing ir_sequence_date=sequence_date in the context when generating sequences.
What I Need Help With
- Automatic Monthly Reset: How can I ensure sequences reset automatically every month?
- Custom Logic: Do I need custom logic to create monthly date ranges, or should Odoo handle this automatically with use_date_range=True?
- Best Practices: Are there any best practices or common pitfalls when working with date ranges and sequence resets in Odoo?
Any guidance or suggestions would be greatly appreciated. Thank you!