Skip to content

Commit

Permalink
fix: Check if Item is serialised before trying to fetch SN and set SO…
Browse files Browse the repository at this point in the history
… in it (frappe#27358)
  • Loading branch information
marination authored Sep 7, 2021
1 parent 058d983 commit 61a1356
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erpnext/stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,8 @@ def update_so_in_serial_number(self):
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:
Expand Down

0 comments on commit 61a1356

Please sign in to comment.