Commit Graph

12 Commits

Author SHA1 Message Date
Denis Roussel
bc363dfae7 [IMP] stock_reserve_rule: Change package type to package level 2023-07-18 09:16:01 +02:00
Ricardoalso
e1eb6cf089 [MIG] stock_reserve_rule: Migration to 15.0 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
aebb0818b0 Add explicit filter on picking type 2023-07-14 09:20:31 +02:00
Guewen Baconnier
12957cdd52 Improve usability 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
4fd7ef9d2e Run pre-commit with xml prettier 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