forked from OCA/wms
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend: Fix issue on stock out endpoints
When we create a stock issue, create an inventory with the quantity of units to keep. The quantity to keep is the quantity of products which have been picked (qty_done > 0). To do so, we unreserve the move lines in the location where qty_done == 0, so remain only the picked ones, and when creating the inventory, we sum the move lines quantities. As the state of a move line is a related to the move, we have to include "partially_available" ones. It is important to keep the domain on the state to exclude cancel and done moves, and it should be more efficient to filter on assigned/partially_available than to exclude all the others. A scenario where it was observed is: In a location, we have 2 packages: * Pack1: 2 units * Pack2: 100 units We create a move for 100 units, it creates 2 move lines: * 2 units from Pack1 * 98 units from Pack2 In the application, we scan Pack1, move only 1 unit to a destination Bin. The next line is shown for the remaining unit of Pack1, we use the "stock out" button. At this point, what we expect: * The inventory for Pack1 is created with 1 unit (to satisfy the first unit put in the destination Bin) Before the correction: * The inventory for Pack1 is created with 0 unit, because the move is "partially_available", so the move line for the picked unit is ignored. I researched for other occurrences where we do not search for "partially_available" on move lines and fixed them.
- Loading branch information
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters