mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
Merge branch 'master' into develop
This commit is contained in:
@@ -105,12 +105,12 @@ def set_batch_nos(doc, warehouse_field, throw = False):
|
||||
for d in doc.items:
|
||||
has_batch_no = frappe.db.get_value('Item', d.item_code, 'has_batch_no')
|
||||
warehouse = d.get(warehouse_field, None)
|
||||
if has_batch_no and warehouse and d.qty > 0:
|
||||
if has_batch_no and warehouse and d.stock_qty > 0:
|
||||
if not d.batch_no:
|
||||
d.batch_no = get_batch_no(d.item_code, warehouse, d.qty, throw)
|
||||
d.batch_no = get_batch_no(d.item_code, warehouse, d.stock_qty, throw)
|
||||
else:
|
||||
batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse)
|
||||
if flt(batch_qty) < flt(d.qty):
|
||||
if flt(batch_qty) < flt(d.stock_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, throw=False):
|
||||
|
||||
@@ -713,7 +713,7 @@
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@@ -1956,7 +1956,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-05-10 17:14:50.456930",
|
||||
"modified": "2017-09-27 08:31:38.768846",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note Item",
|
||||
|
||||
Reference in New Issue
Block a user