mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-18 08:58:43 +00:00
fix: handle missing serial and batch bundle in print format
(cherry picked from commit 548d90df4f)
This commit is contained in:
@@ -608,10 +608,16 @@ def get_serial_nos_from_bundle(serial_and_batch_bundle, serial_nos=None):
|
|||||||
def get_serial_or_batch_nos(bundle):
|
def get_serial_or_batch_nos(bundle):
|
||||||
# For print format
|
# For print format
|
||||||
|
|
||||||
|
if not bundle:
|
||||||
|
return ""
|
||||||
|
|
||||||
bundle_data = frappe.get_cached_value(
|
bundle_data = frappe.get_cached_value(
|
||||||
"Serial and Batch Bundle", bundle, ["has_serial_no", "has_batch_no"], as_dict=True
|
"Serial and Batch Bundle", bundle, ["has_serial_no", "has_batch_no"], as_dict=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not bundle_data:
|
||||||
|
return bundle
|
||||||
|
|
||||||
fields = []
|
fields = []
|
||||||
if bundle_data.has_serial_no:
|
if bundle_data.has_serial_no:
|
||||||
fields.append("serial_no")
|
fields.append("serial_no")
|
||||||
|
|||||||
Reference in New Issue
Block a user