Merge pull request #18090 from scmmishra/twelve-fixes

fix: print message for insufficient stock
This commit is contained in:
Aditya Hase 2019-06-27 18:18:24 +05:30 committed by GitHub
commit b9c9ada3f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,10 +376,10 @@ class StockEntry(StockController):
# validate qty during submit # validate qty during submit
if d.docstatus==1 and d.s_warehouse and not allow_negative_stock and flt(d.actual_qty, d.precision("actual_qty")) < flt(d.transfer_qty, d.precision("actual_qty")): if d.docstatus==1 and d.s_warehouse and not allow_negative_stock and flt(d.actual_qty, d.precision("actual_qty")) < flt(d.transfer_qty, d.precision("actual_qty")):
frappe.throw(_("Row {0}: Qty not available for {4} in warehouse {1} at posting time of the entry ({2} {3})").format(d.idx, frappe.throw(_("Row {0}: Quantity not available for {4} in warehouse {1} at posting time of the entry ({2} {3})").format(d.idx,
frappe.bold(d.s_warehouse), formatdate(self.posting_date), frappe.bold(d.s_warehouse), formatdate(self.posting_date),
format_time(self.posting_time), frappe.bold(d.item_code)) format_time(self.posting_time), frappe.bold(d.item_code))
+ '<br><br>' + _("Available qty is {0}, you need {1}").format(frappe.bold(d.actual_qty), + '<br><br>' + _("Available quantity is {0}, you need {1}").format(frappe.bold(d.actual_qty),
frappe.bold(d.transfer_qty)), frappe.bold(d.transfer_qty)),
NegativeStockError, title=_('Insufficient Stock')) NegativeStockError, title=_('Insufficient Stock'))