diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 011f21fe388..599221185d9 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -4,7 +4,7 @@ from collections import defaultdict import frappe -from frappe import _ +from frappe import _, bold from frappe.model.meta import get_field_precision from frappe.utils import cint, flt, format_datetime, get_datetime @@ -40,11 +40,12 @@ def validate_return_against(doc): frappe.throw( _("The {0} {1} does not match with the {0} {2} in the {3} {4}").format( doc.meta.get_label(party_type), - doc.get(party_type), - ref_doc.get(party_type), + bold(doc.get(party_type)), + bold(ref_doc.get(party_type)), ref_doc.doctype, ref_doc.name, - ) + ), + title=_("Party Mismatch"), ) if ( diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 5f7cfb165d4..d85c1b28f97 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -68,10 +68,13 @@ class SellingController(StockController): serial_nos = frappe.get_all( "Serial and Batch Entry", - filters={"parent": ("in", bundle_ids)}, + filters={"parent": ("in", bundle_ids), "serial_no": ("is", "set")}, pluck="serial_no", ) + if not serial_nos: + return + if serial_nos := frappe.get_all( "Serial No", filters={"name": ("in", serial_nos), "customer": ("is", "set")},