fix: use serial batch fields for subcontracting receipt (backport #40311) (#40315)

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:
mergify[bot]
2024-03-06 19:59:21 +05:30
committed by GitHub
parent 7001e0a820
commit 4b15c00b11
7 changed files with 143 additions and 113 deletions

View File

@@ -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()