diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 83a7ff12ab..396ec98c51 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -298,7 +298,7 @@ def make_time_log(name, operation, from_time, to_time, qty=None, project=None, @frappe.whitelist() def auto_make_time_log(production_order_id): - if frappe.db.get_value("Time Log", filters={"production_order": production_order_id}): + if frappe.db.get_value("Time Log", filters={"production_order": production_order_id, "docstatus":1}): frappe.throw(_("Time logs already exists against this Production Order")) time_logs = []