Commit Graph

19 Commits

Author SHA1 Message Date
Denis Roussel
2c4bfbfaff [IMP] stock_reserve_rule: Don't evaluate strategies if needed quantity is already taken 2024-10-07 10:53:06 +02:00
Denis Roussel
bc363dfae7 [IMP] stock_reserve_rule: Change package type to package level 2023-07-18 09:16:01 +02:00
Denis Roussel
2ef4a28410 [MIG][16.0] stock_reserve_rule 2023-07-14 09:40:15 +02:00
Ricardoalso
eab02d3615 Removing product_packaging_type dependency and replacing it by the fields available in stock module V15 2023-07-14 09:20:31 +02:00
Ricardoalso
e1eb6cf089 [MIG] stock_reserve_rule: Migration to 15.0 2023-07-14 09:20:31 +02:00
Michael Tietz
45cbe2b4d7 stock_reserve_rule: fix _apply_strategy_empty_bin
rule now only gets applied if no other products are allocating the location
2023-07-14 09:20:31 +02:00
Jacques-Etienne Baudoux
0a75207e13 [FIX] stock_reserve_rule: rule matching
A move from "Stock/Zone1/A" must match removal rules defined for
"Stock/Zone1"
2023-07-14 09:20:31 +02:00
Sébastien Alix
98c31d1f35 [MIG] stock_reserve_rule: Migration to 14.0 2023-07-14 09:20:31 +02:00
Guewen Baconnier
c929d72729 Modify packaging rule to always respect fifo, lifo, ...
The former implementation was to take as much as possible of the largest
packaging, to the smallest packacking, to have less to move.
Then, only, removal order (fifo, ...) was applied for equal quantities.
It is more important to respect removal order than limiting the
operations, so remove this "optimization".
2023-07-14 09:20:31 +02:00
Guewen Baconnier
0319daab42 Modify empty bin rule to always respect fifo, lifo, ...
The former implementation was sorting the quants per location and trying
to take as much quantities as possible from the same locations, to limit
the number of operations to do. Then, only, removal order (fifo, ...)
was applied. It is more important to respect removal order than limiting
the operations, so remove this "optimization".
2023-07-14 09:20:31 +02:00
Guewen Baconnier
dc118cda5a Change picking type to many2many in reserve rules 2023-07-14 09:20:31 +02:00
Guewen Baconnier
23eec98498 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.
2023-07-14 09:20:31 +02:00
Guewen Baconnier
aebb0818b0 Add explicit filter on picking type 2023-07-14 09:20:31 +02:00
Guewen Baconnier
5060ba8d11 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
2023-07-14 09:20:30 +02:00
Guewen Baconnier
f5b3d4dec1 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.
2023-07-14 09:20:30 +02:00
Guewen Baconnier
5f596a5775 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.
2023-07-14 09:20:30 +02:00
sebalix
9481c6061b [IMP] stock_reserve_rule: add constraints on fallback locations 2023-07-14 09:20:30 +02:00
Guewen Baconnier
086db87a38 Migrate stock_reserve_rule to 13.0 2023-07-14 09:20:30 +02:00
Guewen Baconnier
c683bb3251 Add stock_reserve_rule 2023-07-14 09:20:30 +02:00