mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix(job card): only hold during draft state (#31243)
This commit is contained in:
19
erpnext/patches/v13_0/job_card_status_on_hold.py
Normal file
19
erpnext/patches/v13_0/job_card_status_on_hold.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
job_cards = frappe.get_all(
|
||||
"Job Card",
|
||||
{"status": "On Hold", "docstatus": ("!=", 0)},
|
||||
pluck="name",
|
||||
)
|
||||
|
||||
for idx, job_card in enumerate(job_cards):
|
||||
try:
|
||||
doc = frappe.get_doc("Job Card", job_card)
|
||||
doc.set_status()
|
||||
doc.db_set("status", doc.status, update_modified=False)
|
||||
if idx % 100 == 0:
|
||||
frappe.db.commit()
|
||||
except Exception:
|
||||
continue
|
||||
Reference in New Issue
Block a user