Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#876 Duplicate key error on 1.4 (where same workflow works on 1.3)

Erik Huelsmann

[2013-06-16 21:01:39] <freelock_> ERROR: duplicate key value violates unique constraint "voucher_pkey"
[2013-06-16 21:01:51] <freelock_> Conflict with Existing Data. Perhaps you already entered this?
[2013-06-16 21:02:32] <freelock_> ... just doing some paralel work in 1.3 and 1.4. In this case, I have 3 different payments for 3 different invoices for the same customer on the same day
[2013-06-16 21:03:19] <freelock_> trying to use cash -> vouchers -> receipts to receive payment. In 1.3, I save the batch. This takes me to the batch edit screen, where I hit next,
[2013-06-16 21:03:38] <freelock_> and then add the second payment source and balance against the partial value.
[2013-06-16 21:03:46] <freelock_> Same actions in 1.4 triggers this error.
[2013-06-16 21:04:46] <freelock_> hmm, hang on, when I backed up and saved again it worked.
[2013-06-16 21:04:56] <freelock_> maybe just a double-submit of the form?
[2013-06-16 21:07:01] <freelock_> oh weird, precision issue here, $53.66 in 1.3, $53.655 in 1.4
[2013-06-16 21:09:40] <freelock_> nope, duplicate key error is back with 3rd transaction
[2013-06-16 21:14:52] <freelock_> no summary total on open sales order report (and far more open than in 1.3)


  • Chris Travers
    Chris Travers

    Reviewing the code, there is no relevant change here. The most likely cause is that somehow the voucher_id_seq sequence got out of whack since that is the source of voucher_id which is the primary key. Going to close as works for me.

  • Chris Travers
    Chris Travers

    • status: open --> closed-works-for-me