Skip to content

Commit

Permalink
fix: 'NoneType' object has no attribute 'has_serial_no' (backport #43514
Browse files Browse the repository at this point in the history
) (#43574)

fix: 'NoneType' object has no attribute 'has_serial_no' (#43514)

(cherry picked from commit 6ddda6c)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Oct 9, 2024
1 parent 660d20f commit 60508a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/controllers/stock_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ def get_reference_ids(self, table_name, qty_field=None, bundle_field=None) -> tu

@frappe.request_cache
def is_serial_batch_item(self, item_code) -> bool:
if not frappe.db.exists("Item", item_code):
frappe.throw(_("Item {0} does not exist.").format(bold(item_code)))

item_details = frappe.db.get_value("Item", item_code, ["has_serial_no", "has_batch_no"], as_dict=1)

if item_details.has_serial_no or item_details.has_batch_no:
Expand Down

0 comments on commit 60508a9

Please sign in to comment.