feat: certificate pdf and custom certificate

This commit is contained in:
Jannat Patel
2023-04-14 17:38:24 +05:30
parent 262c1ea371
commit 53d2e288d4
9 changed files with 143 additions and 166 deletions

View File

@@ -0,0 +1,25 @@
import frappe
def execute():
certificates = frappe.get_all("LMS Certificate", fields=["member", "name"])
for certificate in certificates:
if not frappe.db.exists(
"DocShare",
{
"share_doctype": "LMS Certificate",
"share_name": certificate.name,
"user": certificate.member,
},
):
share = frappe.get_doc(
{
"doctype": "DocShare",
"user": certificate.member,
"share_doctype": "LMS Certificate",
"share_name": certificate.name,
"read": 1,
}
)
share.save(ignore_permissions=True)