Sidhra_Audit_System/sidrah_business/patches/backfill_process_status_unknown.py
2026-10-09 12:16:48 +05:30

14 lines
459 B
Python

import frappe
def execute():
"""SB Process.status now defaults to 'Unknown' for new records, but existing
records created before that default was added are still NULL/blank — which
silently falls outside the Pass/Fail/Unknown breakdown shown on the dashboard.
Backfill them so every record has one of exactly the three valid statuses."""
frappe.db.sql("""
UPDATE `tabSB Process`
SET status = 'Unknown'
WHERE status IS NULL OR status = ''
""")