Skip to content
Snippets Groups Projects
Commit b1491b76 authored by william-andre's avatar william-andre
Browse files

[FIX] account: locking in partner customer/supplier rank update

2 fixes are made:
* We use a FOR NO KEY UPDATE instead of FOR UPDATE because we don't want
  to prevent the insertion of lines referencing the partner as a foreign
  key (i.e. new invoices).
  The data is purely informative and the exact value isn't too important
  anyways.
* We catch SerializationFailure on top of the previously catched
  LockNotAvailable. It can happen in this use case
  - T1 and T2 start
  - T1 acquires the lock and updates
  - T1 commits
  - T2 acquires the lock: it gets it because T1 released it
  - T2 updates: T1 did it as well so there is a serialization failure.

Part-of: odoo/odoo#104606
parent e1f06479
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment