Skip to content

Commit

Permalink
Merge pull request #226 from RitvikSardana/develop-ritvik-patch-si-as…
Browse files Browse the repository at this point in the history
…sessment-group

fix: add patch for sales invoice permission and parent assessment group
  • Loading branch information
RitvikSardana committed Mar 26, 2024
2 parents 7956a7b + 54c853d commit 18d13e5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions education/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ education.patches.v14_0.delete_lms_user_role
education.patches.v15_0.fees_student_email
education.patches.v15_0.student_role_desk_access
education.patches.v15_0.sales_invoice_student_field
education.patches.v15_0.create_parent_assessment_group
education.patches.v15_0.student_role_permission_sales_invoice
6 changes: 6 additions & 0 deletions education/patches/v15_0/create_parent_assessment_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import frappe
from education.install import create_parent_assessment_group


def execute():
create_parent_assessment_group()
18 changes: 18 additions & 0 deletions education/patches/v15_0/student_role_permission_sales_invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import frappe
from frappe.permissions import add_permission, update_permission_property


def execute():

add_permission("Sales Invoice", "Student", 0)

doctype = "Sales Invoice"
role = "Student"
permlevel = 0
ptype = ["read", "write", "print"]

for p in ptype:
# update permissions
update_permission_property(doctype, role, permlevel, p, 1)

frappe.db.commit()

0 comments on commit 18d13e5

Please sign in to comment.