Files
enlight-lms/lms/patches/v0_0/certification_member_field_data.py
2022-11-04 11:47:09 +05:30

11 lines
302 B
Python

import frappe
def execute():
frappe.reload_doc("lms", "doctype", "lms_certification")
certificates = frappe.get_all("LMS Certification", fields=["name", "student"])
for certificate in certificates:
frappe.db.set_value(
"LMS Certification", certificate.name, "member", certificate.student
)