fix: Job Card sub operations status and list view (backport #30243) (#30256)
* fix: show status in job card list view in Draft mode
(cherry picked from commit fa32fc3c832196004154055ac1b2334d6202c261)
* fix: job card - sub operations table status misbehaviour on pause / resume Job Card
(cherry picked from commit 7b8723445ee695e88590bb833f60a0c4731106fa)
Co-authored-by: Anoop Kurungadam <anoop@earthianslive.com>
diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py
index 9f4ace2..5f492d7 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card.py
@@ -48,7 +48,7 @@
self.validate_work_order()
def set_sub_operations(self):
- if self.operation:
+ if not self.sub_operations and self.operation:
self.sub_operations = []
for row in frappe.get_all('Sub Operation',
filters = {'parent': self.operation}, fields=['operation', 'idx'], order_by='idx'):
diff --git a/erpnext/manufacturing/doctype/job_card/job_card_list.js b/erpnext/manufacturing/doctype/job_card/job_card_list.js
index 8017209..7f60bdc 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card_list.js
+++ b/erpnext/manufacturing/doctype/job_card/job_card_list.js
@@ -1,4 +1,5 @@
frappe.listview_settings['Job Card'] = {
+ has_indicator_for_draft: true,
get_indicator: function(doc) {
if (doc.status === "Work In Progress") {
return [__("Work In Progress"), "orange", "status,=,Work In Progress"];