fix: item code not showing in the error message

This commit is contained in:
Rohit Waghchaure
2025-04-25 14:08:38 +05:30
parent a2595350f6
commit 48748e7142

View File

@@ -1189,16 +1189,16 @@ class update_entries_after:
) in frappe.local.flags.currently_saving: ) in frappe.local.flags.currently_saving:
msg = _("{0} units of {1} needed in {2} to complete this transaction.").format( msg = _("{0} units of {1} needed in {2} to complete this transaction.").format(
abs(deficiency), abs(deficiency),
frappe.get_desk_link("Item", exceptions[0]["item_code"]), frappe.get_desk_link("Item", exceptions[0]["item_code"], show_title_with_name=True),
frappe.get_desk_link("Warehouse", warehouse), frappe.get_desk_link("Warehouse", warehouse, show_title_with_name=True),
) )
else: else:
msg = _( msg = _(
"{0} units of {1} needed in {2} on {3} {4} for {5} to complete this transaction." "{0} units of {1} needed in {2} on {3} {4} for {5} to complete this transaction."
).format( ).format(
abs(deficiency), abs(deficiency),
frappe.get_desk_link("Item", exceptions[0]["item_code"]), frappe.get_desk_link("Item", exceptions[0]["item_code"], show_title_with_name=True),
frappe.get_desk_link("Warehouse", warehouse), frappe.get_desk_link("Warehouse", warehouse, show_title_with_name=True),
exceptions[0]["posting_date"], exceptions[0]["posting_date"],
exceptions[0]["posting_time"], exceptions[0]["posting_time"],
frappe.get_desk_link(exceptions[0]["voucher_type"], exceptions[0]["voucher_no"]), frappe.get_desk_link(exceptions[0]["voucher_type"], exceptions[0]["voucher_no"]),
@@ -1659,8 +1659,8 @@ def validate_negative_qty_in_future_sle(args, allow_negative_stock=False):
if is_negative_with_precision(neg_sle): if is_negative_with_precision(neg_sle):
message = _("{0} units of {1} needed in {2} on {3} {4} for {5} to complete this transaction.").format( message = _("{0} units of {1} needed in {2} on {3} {4} for {5} to complete this transaction.").format(
abs(neg_sle[0]["qty_after_transaction"]), abs(neg_sle[0]["qty_after_transaction"]),
frappe.get_desk_link("Item", args.item_code), frappe.get_desk_link("Item", args.item_code, show_title_with_name=True),
frappe.get_desk_link("Warehouse", args.warehouse), frappe.get_desk_link("Warehouse", args.warehouse, show_title_with_name=True),
neg_sle[0]["posting_date"], neg_sle[0]["posting_date"],
neg_sle[0]["posting_time"], neg_sle[0]["posting_time"],
frappe.get_desk_link(neg_sle[0]["voucher_type"], neg_sle[0]["voucher_no"]), frappe.get_desk_link(neg_sle[0]["voucher_type"], neg_sle[0]["voucher_no"]),