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:
Rucha Mahabal
2020-04-30 19:47:18 +05:30
committed by GitHub
parent 4422ffdb22
commit f65fb1fcf8
9 changed files with 25 additions and 169 deletions

View File

@@ -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()