Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] point_of_sale: lost pos orders on IntegrityError #32577

Conversation

beledouxdenis
Copy link
Contributor

This revision is similar to
605b94e

except that instead of an OperationalError
(e.g. a conccurent update),
this is an IntegrityError which is raised,
an sql constraint which is not met,
e.g. a unique or required constraint.

In the case of this opw,
this is the picking name unique constraint
which was not met,
the picking sequence number has somehow been re-used.

Both
psycopg2.OperationalError
and
psycopg2.IntegrityError
inherits from
psycopg2.DatabaseError

We therefore choose to use this Exception class,
to include all kind of psycopg2 exceptions that prevent
the transaction to be committed.

opw-1965679

This revision is similar to
605b94e

except that instead of an OperationalError
(e.g. a conccurent update),
this is an IntegrityError which is raised,
an sql constraint which is not met,
e.g. a unique or required constraint.

In the case of this opw,
this is the picking name unique constraint
which was not met,
the picking sequence number has somehow been re-used.

Both
`psycopg2.OperationalError`
and
`psycopg2.IntegrityError`
inherits from
`psycopg2.DatabaseError`

We therefore choose to use this Exception class,
to include all kind of psycopg2 exceptions that prevent
the transaction to be committed.

opw-1965679
@beledouxdenis
Copy link
Contributor Author

robodoo r+

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 10, 2019
robodoo pushed a commit that referenced this pull request Apr 10, 2019
This revision is similar to
605b94e

except that instead of an OperationalError
(e.g. a conccurent update),
this is an IntegrityError which is raised,
an sql constraint which is not met,
e.g. a unique or required constraint.

In the case of this opw,
this is the picking name unique constraint
which was not met,
the picking sequence number has somehow been re-used.

Both
`psycopg2.OperationalError`
and
`psycopg2.IntegrityError`
inherits from
`psycopg2.DatabaseError`

We therefore choose to use this Exception class,
to include all kind of psycopg2 exceptions that prevent
the transaction to be committed.

opw-1965679

closes #32577

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses merging 👷 and removed merging 👷 labels Apr 10, 2019
@robodoo
Copy link
Contributor

robodoo commented Apr 10, 2019

Merged, thanks!

@robodoo robodoo closed this Apr 10, 2019
@MiquelRForgeFlow
Copy link
Contributor

@beledouxdenis maybe you could take a look at #27684, please. It's unrelated to this PR but does an identical fix.

@beledouxdenis beledouxdenis deleted the 10.0-fix-lostposordersintegrityerror-dle branch October 16, 2019 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants