mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 01:34:10 +00:00
fix(stock): remove limit filter while fetching batch and bin
This commit is contained in:
@@ -686,18 +686,14 @@ def get_available_item_locations(
|
|||||||
locations = get_available_item_locations_for_batched_item(
|
locations = get_available_item_locations_for_batched_item(
|
||||||
item_code,
|
item_code,
|
||||||
from_warehouses,
|
from_warehouses,
|
||||||
required_qty,
|
|
||||||
company,
|
company,
|
||||||
total_picked_qty,
|
|
||||||
consider_rejected_warehouses=consider_rejected_warehouses,
|
consider_rejected_warehouses=consider_rejected_warehouses,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
locations = get_available_item_locations_for_other_item(
|
locations = get_available_item_locations_for_other_item(
|
||||||
item_code,
|
item_code,
|
||||||
from_warehouses,
|
from_warehouses,
|
||||||
required_qty,
|
|
||||||
company,
|
company,
|
||||||
total_picked_qty,
|
|
||||||
consider_rejected_warehouses=consider_rejected_warehouses,
|
consider_rejected_warehouses=consider_rejected_warehouses,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -790,9 +786,7 @@ def get_available_item_locations_for_serialized_item(
|
|||||||
def get_available_item_locations_for_batched_item(
|
def get_available_item_locations_for_batched_item(
|
||||||
item_code,
|
item_code,
|
||||||
from_warehouses,
|
from_warehouses,
|
||||||
required_qty,
|
|
||||||
company,
|
company,
|
||||||
total_picked_qty=0,
|
|
||||||
consider_rejected_warehouses=False,
|
consider_rejected_warehouses=False,
|
||||||
):
|
):
|
||||||
sle = frappe.qb.DocType("Stock Ledger Entry")
|
sle = frappe.qb.DocType("Stock Ledger Entry")
|
||||||
@@ -813,7 +807,6 @@ def get_available_item_locations_for_batched_item(
|
|||||||
.groupby(sle.warehouse, sle.batch_no, sle.item_code)
|
.groupby(sle.warehouse, sle.batch_no, sle.item_code)
|
||||||
.having(Sum(sle.actual_qty) > 0)
|
.having(Sum(sle.actual_qty) > 0)
|
||||||
.orderby(IfNull(batch.expiry_date, "2200-01-01"), batch.creation, sle.batch_no, sle.warehouse)
|
.orderby(IfNull(batch.expiry_date, "2200-01-01"), batch.creation, sle.batch_no, sle.warehouse)
|
||||||
.limit(ceil(required_qty + total_picked_qty))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if from_warehouses:
|
if from_warehouses:
|
||||||
@@ -838,7 +831,6 @@ def get_available_item_locations_for_serial_and_batched_item(
|
|||||||
locations = get_available_item_locations_for_batched_item(
|
locations = get_available_item_locations_for_batched_item(
|
||||||
item_code,
|
item_code,
|
||||||
from_warehouses,
|
from_warehouses,
|
||||||
required_qty,
|
|
||||||
company,
|
company,
|
||||||
consider_rejected_warehouses=consider_rejected_warehouses,
|
consider_rejected_warehouses=consider_rejected_warehouses,
|
||||||
)
|
)
|
||||||
@@ -872,9 +864,7 @@ def get_available_item_locations_for_serial_and_batched_item(
|
|||||||
def get_available_item_locations_for_other_item(
|
def get_available_item_locations_for_other_item(
|
||||||
item_code,
|
item_code,
|
||||||
from_warehouses,
|
from_warehouses,
|
||||||
required_qty,
|
|
||||||
company,
|
company,
|
||||||
total_picked_qty=0,
|
|
||||||
consider_rejected_warehouses=False,
|
consider_rejected_warehouses=False,
|
||||||
):
|
):
|
||||||
bin = frappe.qb.DocType("Bin")
|
bin = frappe.qb.DocType("Bin")
|
||||||
@@ -883,7 +873,6 @@ def get_available_item_locations_for_other_item(
|
|||||||
.select(bin.warehouse, bin.actual_qty.as_("qty"))
|
.select(bin.warehouse, bin.actual_qty.as_("qty"))
|
||||||
.where((bin.item_code == item_code) & (bin.actual_qty > 0))
|
.where((bin.item_code == item_code) & (bin.actual_qty > 0))
|
||||||
.orderby(bin.creation)
|
.orderby(bin.creation)
|
||||||
.limit(ceil(required_qty + total_picked_qty))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if from_warehouses:
|
if from_warehouses:
|
||||||
|
|||||||
Reference in New Issue
Block a user