Remove check_invoice_sequences
On the fiscal year and period, there is a check that ensure the same sequence is not used more than once ('check_invoice_sequences').
A part that such constraint written with SQL query is not safe against concurrent transactions, the discussion [1] shows that there are use cases where user wants to reuse the same sequence over different fiscal years.
Here is my proposal.
We drop the 'check_invoice_sequences' and replace it by a check when setting the number on an invoice to ensure that the invoice date not before any invoice dates numbered with the same sequence. With this constraint we ensure the correct usage of the sequence independently of the way the fiscal years are configured.
On the technical point of view, I think we will have to store on the invoice the sequence used.
Also this check is only useful for the 'out' invoices.
[1] https://groups.google.com/d/topic/tryton/a4fobeaYn48/discussion