fix: added serial no condition

(cherry picked from commit bb7ddd11f1)
This commit is contained in:
Rohit Waghchaure
2025-07-15 17:27:00 +05:30
committed by Mergify
parent 6b68a50cc4
commit 467fe1d72f
2 changed files with 9 additions and 5 deletions

View File

@@ -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 (

View File

@@ -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")},