feat: certificate template
This commit is contained in:
19
lms/patches/v1_0/add_certificate_template.py
Normal file
19
lms/patches/v1_0/add_certificate_template.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
default_certificate_template = frappe.db.get_value(
|
||||
"Property Setter",
|
||||
{
|
||||
"doc_type": "LMS Certificate",
|
||||
"property": "default_print_format",
|
||||
},
|
||||
"value",
|
||||
)
|
||||
|
||||
if frappe.db.exists("Print Format", default_certificate_template):
|
||||
certificates = frappe.get_all("LMS Certificate", pluck="name")
|
||||
for certificate in certificates:
|
||||
frappe.db.set_value(
|
||||
"LMS Certificate", certificate, "template", default_certificate_template
|
||||
)
|
||||
Reference in New Issue
Block a user