Browse Source

fix: Maintenance Schedule child table status for legacy data (#27554)

* fix: Maintenance Schedule child table status for legacy data

* fix: Include legacy draft schedules in patch

* fix: Pre-commit formatting
develop
Marica 3 years ago
committed by GitHub
parent
commit
cc143bca0d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json
  2. 9
      erpnext/patches/v13_0/set_status_in_maintenance_schedule_table.py

8
erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json

@ -89,13 +89,14 @@
"width": "160px"
},
{
"allow_on_submit": 1,
"columns": 2,
"default": "Pending",
"fieldname": "completion_status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Completion Status",
"options": "Pending\nPartially Completed\nFully Completed",
"read_only": 1
"options": "Pending\nPartially Completed\nFully Completed"
},
{
"fieldname": "column_break_3",
@ -125,10 +126,11 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2021-05-27 16:07:25.905015",
"modified": "2021-09-16 21:25:22.506485",
"modified_by": "Administrator",
"module": "Maintenance",
"name": "Maintenance Schedule Detail",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",

9
erpnext/patches/v13_0/set_status_in_maintenance_schedule_table.py

@ -0,0 +1,9 @@
import frappe
def execute():
frappe.db.sql("""
UPDATE `tabMaintenance Schedule Detail`
SET completion_status = 'Pending'
WHERE docstatus < 2
""")
Loading…
Cancel
Save