From bb7ddd11f104a27086e83915acac6ddd48acee9c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 15 Jul 2025 17:27:00 +0530 Subject: [PATCH] fix: added serial no condition --- erpnext/controllers/sales_and_purchase_return.py | 9 +++++---- erpnext/controllers/selling_controller.py | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 8e2333cec1b..84e557bb5dc 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.query_builder import DocType from frappe.query_builder.functions import Abs @@ -42,11 +42,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 4eb99dbecc5..f5350fedfa9 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -72,10 +72,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")},