Commit Graph

8 Commits

Author SHA1 Message Date
Guewen Baconnier
912a3e9239 Fix test incompatibility with stock_reserve_rule
The rules created in demo data of stock_reserve_rule make the tests of
stock_vertical_lift (and possibly other modules) fail because the
transfers can't be made available.

Deactivate the rule in stock_reserve_rule and activate it only in its
tests. Users can still activate the rule manually to test.
2020-08-27 11:50:34 +02:00
Guewen Baconnier
3d977e92e2 Add explicit filter on picking type 2020-05-25 08:30:02 +02:00
Guewen Baconnier
55bbc44a62 Remove fallback location
It could not work properly here as we need the "fallback" to apply
even if there is no quantity at all in the stock. As we hook the
reservation rules in StockMove._update_reserved_quantity(), and
this method is called only if we have at least 1 product in qty,
the fallback was not applied with zero qty.

A new module will handle this concept: https://github.com/OCA/wms/pull/28
2020-05-20 15:31:18 +02:00
Guewen Baconnier
89e4ea230f Fix application of removal rules too broad
Example of configuration:

Rule location: Stock
Removal rule 1: Stock/Zone1
Removal rule 2: Stock/Zone2

Reservation of a stock move with Stock/Zone2 as source location.

Previously, it would reserve in Stock/Zone1.
Now, it will never be allowed to reserve in Stock/Zone1.

A warning message was added previously to warn the user about potential
issues, which is now obsolete so I removed it.
2020-05-15 08:03:12 +02:00
Guewen Baconnier
c99c97ffa4 Fix bug in fallback when no quantity could be reserved
Before the change, the implementation of the fallback goes like this:

If I reserve a move of 3000 and it finds 600 units, it splits the move
to create a new move of 2400 and pretend to the caller that 3000 was
reserved so the initial move is changed to 'assigned'.

Now, if we have a move of 2400 and finds zero, it still splits the move,
and pretend to the caller that 2400 was reserved → the initial move has
no move line but is assigned. In this case, we should not split the move
but only update the source location of the move.
2020-05-14 16:08:21 +02:00
sebalix
4e4d2d7130 [IMP] stock_reserve_rule: add constraints on fallback locations 2020-04-30 10:18:45 +02:00
Guewen Baconnier
7a43a1c67d Migrate stock_reserve_rule to 13.0 2020-03-17 10:39:10 +01:00
Guewen Baconnier
3494c2671d Add stock_reserve_rule 2020-03-17 10:39:10 +01:00