diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index faa6b08398d..57bda11fbc4 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -770,6 +770,7 @@ class WorkOrder(Document): self.db_set("status", "Cancelled") self.on_close_or_cancel() + self.delete_job_card() def on_close_or_cancel(self): if self.production_plan and frappe.db.exists( @@ -779,7 +780,6 @@ class WorkOrder(Document): else: self.update_work_order_qty_in_so() - self.delete_job_card() self.update_completed_qty_in_material_request() self.update_planned_qty() self.update_ordered_qty()