Currently, the sequences for sales, purchases, shipments, etc., when defined with the parameter ${year}, take into account the current date on which the record is being processed.
For example, if today’s date is 01/01/2025, but I want to create a sale with the date 31/12/2024, the sequence will assign the year 2025.
It would be useful for the ${year} parameter in sequences to consider the date of the document instead. For sales, it should use the sale date, and for shipments, the effective date.
The sequence is already designed to use a contextual date like it does for invoice.
But the problem is that this prevents to use get_many to number many records at once.
But this should not be a problem as the grouping may be set to call with diferent groupings as done in invoice.
Normally all the functions used to number (set_number) test if the number is set first, so it can be easly overriden to set the number in a diferent grouping before calling the standard method so anyone can set the desired value. Event its possible to use different sequences if needed.