From afae8a0c462500491669c1c784767af5905eec12 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 8 Aug 2019 15:50:17 +0530 Subject: [PATCH] fix: Show created serial nos as links in message (#18636) Fixes #18623 --- erpnext/stock/doctype/serial_no/serial_no.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index c203f8baa3..409a864678 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -369,10 +369,11 @@ def auto_make_serial_nos(args): elif args.get('actual_qty', 0) > 0: created_numbers.append(make_serial_no(serial_no, args)) - if len(created_numbers) == 1: - frappe.msgprint(_("Serial No {0} created").format(created_numbers[0])) - elif len(created_numbers) > 0: - frappe.msgprint(_("The following serial numbers were created:
{0}").format(', '.join(created_numbers))) + form_links = list(map(lambda d: frappe.utils.get_link_to_form('Serial No', d), created_numbers)) + if len(form_links) == 1: + frappe.msgprint(_("Serial No {0} created").format(form_links[0])) + elif len(form_links) > 0: + frappe.msgprint(_("The following serial numbers were created:
{0}").format(', '.join(form_links))) def get_item_details(item_code): return frappe.db.sql("""select name, has_batch_no, docstatus,