Tryton - Issues

 

Issue5205

Title Remove check_invoice_sequences
Priority feature Status testing
Superseder Nosy List Timitos, ced, pokoli, reviewbot
Type feature request Components account_invoice
Assigned To ced Keywords review
Reviews 267921002
View: 267921002

Created on 2015-12-24.15:03:47 by ced, last changed by reviewbot.

Messages
review267921002 updated at https://codereview.tryton.org/267921002/#ps260121003
review267921002 updated at https://codereview.tryton.org/267921002/#ps258071002
msg51763 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-09-09.18:24:44
Here is review267921002 which implement the check for customer invoices.
msg25741 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2016-05-03.17:16:19
To be precise the date to use for the check is the accounting date (which is the invoice date if not manually set).
msg23441 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2015-12-24.15:17:26
RFC: https://groups.google.com/d/topic/tryton/vaq3mURFeYs/discussion
msg23440 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2015-12-24.15:03:45
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
History
Date User Action Args
2019-09-10 17:44:09reviewbotsetmessages: + msg51787
2019-09-09 18:46:22reviewbotsetnosy: + reviewbot
messages: + msg51764
2019-09-09 18:24:45cedsetstatus: in-progress -> testing
reviews: 267921002
messages: + msg51763
keyword: + review
2019-09-09 14:33:07cedsetstatus: chatting -> in-progress
assignedto: ced
2017-02-16 10:20:38pokolisetnosy: + pokoli
2016-11-28 20:25:17Timitossetnosy: + Timitos
2016-05-03 17:16:20cedsetmessages: + msg25741
2015-12-24 15:17:27cedsetmessages: + msg23441
2015-12-24 15:03:47cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)