fix: Check if Item is serialised before trying to fetch SN and set SO in it (#27358)

This commit is contained in:
Marica 2021-09-07 14:42:17 +05:30 committed by GitHub
parent 058d98342a
commit 61a1356109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1503,7 +1503,8 @@ class StockEntry(StockController):
qty_to_reserve -= reserved_qty[0][0]
if qty_to_reserve > 0:
for item in self.items:
if item.item_code == item_code:
has_serial_no = frappe.get_cached_value("Item", item.item_code, "has_serial_no")
if item.item_code == item_code and has_serial_no:
serial_nos = (item.serial_no).split("\n")
for serial_no in serial_nos:
if qty_to_reserve > 0: