mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 18:01:41 +00:00
fix: Move Video Doctype from Education module to Core (#21234)
* fix: move Video Doctype from Education module to Core * fix: patch to retain Permissions Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
# to retain the roles and permissions from Education Module
|
||||
# after moving doctype to core
|
||||
permissions = frappe.db.sql("""
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`tabDocPerm`
|
||||
WHERE
|
||||
parent='Video'
|
||||
""", as_dict=True)
|
||||
|
||||
frappe.reload_doc('core', 'doctype', 'video')
|
||||
doc = frappe.get_doc('DocType', 'Video')
|
||||
doc.permissions = []
|
||||
for perm in permissions:
|
||||
doc.append('permissions', perm)
|
||||
doc.save()
|
||||
Reference in New Issue
Block a user