Closed HKuz closed 10 months ago
For testing, I checked the following scenarios and all worked as expected:
Transferred half the required materials for Gooseberry Pie Filling in 'Material Transfer for Manufacture' SE Transferred the other half of required materials for Gooseberry Pie Filling in 'Material Transfer for Manufacture' SE Created all Gooseberry Pie Filling in 'Manufacture' SE Moved all Pie Crust required materials in 'Material Transfer for Manufacture' SE, create all pie crusts in 'Manufacture' SE Moved filling/crusts and created Gooseberry Pie Created Delivery Note for Gooseberry Pie
This test case or an equivalent one that tests correcting netting of quantities should be in the test suite. The specifics are in conflict with the use case that Federico brought up the other day. I'll open a ticket related to that separately.
Addresses #49
This bug was partially due to user error - the handling unit only attaches to an item when the item is 'scanned' or is manually linked in the Edit form for the item. This PR also adds code for when a HU is present, if the qty being moved is less than the HU's stock_qty (within qty field's precision number of decimals accuracy), it generates a new HU for the transferred qty. There are a few tweaks to the over-consumption validation - the main one is to use
transfer_qty
field for Stock Entries - digging into the code,actual_qty
is what is available at the source warehouse as of the latest SLE and may be much more than what's being moved. (E.g - a 'Material Transfer for Manufacture' moves a 1lb of butter out of the Refrigerator for pie filling, butactual_qty
is the 50lbs that's available in the fridge).I also commented a conversion in
get_handling_unit
- it was converting parchment paper back to Box units (vs. stock UOM Nos). The query is summingactual_qty
off of SLEs for thestock_qty
field, so it's already in stock_uoms.For testing, I checked the following scenarios and all worked as expected: