mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
minor fix
This commit is contained in:
@@ -197,6 +197,8 @@ class StockEntry(StockController):
|
|||||||
if not self.posting_date or not self.posting_time:
|
if not self.posting_date or not self.posting_time:
|
||||||
frappe.throw(_("Posting date and posting time is mandatory"))
|
frappe.throw(_("Posting date and posting time is mandatory"))
|
||||||
|
|
||||||
|
allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock")
|
||||||
|
|
||||||
for d in self.get('mtn_details'):
|
for d in self.get('mtn_details'):
|
||||||
args = frappe._dict({
|
args = frappe._dict({
|
||||||
"item_code": d.item_code,
|
"item_code": d.item_code,
|
||||||
@@ -209,7 +211,8 @@ class StockEntry(StockController):
|
|||||||
|
|
||||||
# get actual stock at source warehouse
|
# get actual stock at source warehouse
|
||||||
d.actual_qty = get_previous_sle(args).get("qty_after_transaction") or 0
|
d.actual_qty = get_previous_sle(args).get("qty_after_transaction") or 0
|
||||||
if d.s_warehouse and d.actual_qty <= d.transfer_qty:
|
|
||||||
|
if d.s_warehouse and not allow_negative_stock and d.actual_qty <= d.transfer_qty:
|
||||||
frappe.throw(_("""Row {0}: Qty not avalable in warehouse {1} on {2} {3}.
|
frappe.throw(_("""Row {0}: Qty not avalable in warehouse {1} on {2} {3}.
|
||||||
Available Qty: {4}, Transfer Qty: {5}""").format(d.idx, d.s_warehouse,
|
Available Qty: {4}, Transfer Qty: {5}""").format(d.idx, d.s_warehouse,
|
||||||
self.posting_date, self.posting_time, d.actual_qty, d.transfer_qty))
|
self.posting_date, self.posting_time, d.actual_qty, d.transfer_qty))
|
||||||
|
|||||||
Reference in New Issue
Block a user