Commit Graph

8 Commits

Author SHA1 Message Date
OCA-git-bot
384ab7c1ac stock_move_auto_assign 13.0.1.1.0 2021-02-08 20:43:19 +00:00
Guewen Baconnier
cd160b2737 Remove @job decorator
Following changes in https://github.com/OCA/queue/pull/274
2021-01-29 10:56:09 +01:00
Guewen Baconnier
8824a54710 Fix concurrency race condition on picking state
When the 2 last moves of a stock.picking are assigned at the same
time by 2 jobs (different products both available), none of the
transaction will see that it is the last move to be assigned. As a
result, the picking will stay in state "confirmed" even if all its
moves are assigned.

Lock the stock.picking records when we call auto_assign.
If we have many pickings touched for the same product, the lock
can be quite large, so we may have to find a better option.

I could not write a test to exercise this, because we can't have 2
transactions being aware of it, even if we create the picking in demo
data as tests can be run during install.
2021-01-29 10:55:50 +01:00
OCA-git-bot
2a6ef1a26d stock_move_auto_assign 13.0.1.0.1 2020-06-23 09:05:56 +00:00
OCA-git-bot
724d600be7 [ADD] icon.png 2020-06-23 09:05:56 +00:00
OCA-git-bot
35cf7c0d53 [UPD] README.rst 2020-06-23 09:05:55 +00:00
oca-travis
0e8623dcde [UPD] Update stock_move_auto_assign.pot 2020-06-23 08:15:56 +00:00
Guewen Baconnier
d3b1dbdd05 Add stock_move_auto_assign
Automatically check availability of stock moves when a move is set to "done".

It uses queue jobs to verify the availability in order to have a minimal impact
on the user operations.

The conditions to trigger the check are:

* A move is marked as done
* The destination locations of the move lines are internal
* The move doesn't have successors in a chain of moves

At this point, jobs are generated:

* One job per product
* Any move waiting for stock in a parent (or same) location of the internal
  destination locations from the done move has its availability checked

Only one job is generated for an identical set of (product, locations).
2020-06-22 14:57:08 +02:00