From 52d703a232e4e8f88fc32f2263360631e82d8033 Mon Sep 17 00:00:00 2001 From: pratu16x7 Date: Mon, 22 May 2017 11:05:27 +0530 Subject: [PATCH] [fix] test --- erpnext/stock/doctype/batch/batch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index 2ee8c62861..931f2435af 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -115,9 +115,8 @@ def set_batch_nos(doc, warehouse_field, throw = False): if flt(batch_qty) < flt(d.qty): frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.qty)) -def get_batch_no(item_code, warehouse, qty): - '''get the batch number with for the given item_code, warehouse and qty if there - is only one batch''' +def get_batch_no(item_code, warehouse, qty, throw=False): + '''get the smallest batch with for the given item_code, warehouse and qty''' batch_no = None batches = get_batch_qty(item_code = item_code, warehouse = warehouse)