Skip to content

wip: erp5_accounting: invoice number should be continuous

Xiaowu Zhang requested to merge xiaowu.zhang/erp5:invoice_number into master

if use uid IdGenerator, we may have incontinuous invoice number, but it seems it's very important to have continuous one.

the following scenario can reproduce error(in theory):

  1. System call this script when user confirm invoice transaction, an invoice number is generated by portal_ids.generateNewId
  2. If somehow this script ends with database conflit error
  3. This script is called again, a new invoice number is geneated again

And uid IdGenerator use non_continuous_integer_increasing, there has no guarantee for continuous

Capture_d_écran_du_2022-05-06_11-55-34

Edited by Xiaowu Zhang

Merge request reports