@@ -686,18 +686,14 @@ def get_available_item_locations(
686686 locations = get_available_item_locations_for_batched_item (
687687 item_code ,
688688 from_warehouses ,
689- required_qty ,
690689 company ,
691- total_picked_qty ,
692690 consider_rejected_warehouses = consider_rejected_warehouses ,
693691 )
694692 else :
695693 locations = get_available_item_locations_for_other_item (
696694 item_code ,
697695 from_warehouses ,
698- required_qty ,
699696 company ,
700- total_picked_qty ,
701697 consider_rejected_warehouses = consider_rejected_warehouses ,
702698 )
703699
@@ -790,9 +786,7 @@ def get_available_item_locations_for_serialized_item(
790786def get_available_item_locations_for_batched_item (
791787 item_code ,
792788 from_warehouses ,
793- required_qty ,
794789 company ,
795- total_picked_qty = 0 ,
796790 consider_rejected_warehouses = False ,
797791):
798792 sle = frappe .qb .DocType ("Stock Ledger Entry" )
@@ -813,7 +807,6 @@ def get_available_item_locations_for_batched_item(
813807 .groupby (sle .warehouse , sle .batch_no , sle .item_code )
814808 .having (Sum (sle .actual_qty ) > 0 )
815809 .orderby (IfNull (batch .expiry_date , "2200-01-01" ), batch .creation , sle .batch_no , sle .warehouse )
816- .limit (ceil (required_qty + total_picked_qty ))
817810 )
818811
819812 if from_warehouses :
@@ -838,7 +831,6 @@ def get_available_item_locations_for_serial_and_batched_item(
838831 locations = get_available_item_locations_for_batched_item (
839832 item_code ,
840833 from_warehouses ,
841- required_qty ,
842834 company ,
843835 consider_rejected_warehouses = consider_rejected_warehouses ,
844836 )
@@ -872,9 +864,7 @@ def get_available_item_locations_for_serial_and_batched_item(
872864def get_available_item_locations_for_other_item (
873865 item_code ,
874866 from_warehouses ,
875- required_qty ,
876867 company ,
877- total_picked_qty = 0 ,
878868 consider_rejected_warehouses = False ,
879869):
880870 bin = frappe .qb .DocType ("Bin" )
@@ -883,7 +873,6 @@ def get_available_item_locations_for_other_item(
883873 .select (bin .warehouse , bin .actual_qty .as_ ("qty" ))
884874 .where ((bin .item_code == item_code ) & (bin .actual_qty > 0 ))
885875 .orderby (bin .creation )
886- .limit (ceil (required_qty + total_picked_qty ))
887876 )
888877
889878 if from_warehouses :
0 commit comments