fix: use serial batch fields for subcontracting receipt (#40311)
(cherry picked from commit cef6291311)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -434,9 +434,21 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
|
||||
|
||||
filtered_batches = get_filterd_batches(batches)
|
||||
|
||||
if filters.get("is_inward"):
|
||||
filtered_batches.extend(get_empty_batches(filters))
|
||||
|
||||
return filtered_batches
|
||||
|
||||
|
||||
def get_empty_batches(filters):
|
||||
return frappe.get_all(
|
||||
"Batch",
|
||||
fields=["name", "batch_qty"],
|
||||
filters={"item": filters.get("item_code"), "batch_qty": 0.0},
|
||||
as_list=1,
|
||||
)
|
||||
|
||||
|
||||
def get_filterd_batches(data):
|
||||
batches = OrderedDict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user