chore: update reserved stock SLE validation

This commit is contained in:
s-aga-r 2023-04-21 17:44:44 +05:30
parent a527221709
commit 7e8fd8f324

View File

@ -1010,7 +1010,6 @@ class update_entries_after(object):
msg_list = []
for warehouse, exceptions in self.exceptions.items():
deficiency = min(e["diff"] for e in exceptions)
msg_prefix = _("As {} units are reserved").format(frappe.bold(self.reserved_stock))
if (
exceptions[0]["voucher_type"],
@ -1036,7 +1035,10 @@ class update_entries_after(object):
if msg:
if self.reserved_stock:
msg = "{0}, {1}".format(msg_prefix, msg)
allowed_qty = abs(exceptions[0]["actual_qty"]) - abs(exceptions[0]["diff"])
msg = "{0} As {1} units are reserved, you are allowed to consume only {2} units.".format(
msg, frappe.bold(self.reserved_stock), frappe.bold(allowed_qty)
)
msg_list.append(msg)