mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
fix(regional): add permissions for VAT Audit report (#26851)
fix(regional): add permissions for VAT Audit report
This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe, os, json
|
||||
import frappe
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
from frappe.permissions import add_permission, update_permission_property
|
||||
|
||||
def setup(company=None, patch=True):
|
||||
make_custom_fields()
|
||||
add_permissions()
|
||||
|
||||
def make_custom_fields(update=True):
|
||||
@@ -27,10 +28,23 @@ def make_custom_fields(update=True):
|
||||
create_custom_fields(custom_fields, update=update)
|
||||
|
||||
def add_permissions():
|
||||
"""Add Permissions for South Africa VAT Settings and South Africa VAT Account"""
|
||||
"""Add Permissions for South Africa VAT Settings and South Africa VAT Account
|
||||
and VAT Audit Report"""
|
||||
for doctype in ('South Africa VAT Settings', 'South Africa VAT Account'):
|
||||
add_permission(doctype, 'All', 0)
|
||||
for role in ('Accounts Manager', 'Accounts User', 'System Manager'):
|
||||
add_permission(doctype, role, 0)
|
||||
update_permission_property(doctype, role, 0, 'write', 1)
|
||||
update_permission_property(doctype, role, 0, 'create', 1)
|
||||
update_permission_property(doctype, role, 0, 'create', 1)
|
||||
|
||||
|
||||
if not frappe.db.get_value('Custom Role', dict(report="VAT Audit Report")):
|
||||
frappe.get_doc(dict(
|
||||
doctype='Custom Role',
|
||||
report="VAT Audit Report",
|
||||
roles= [
|
||||
dict(role='Accounts User'),
|
||||
dict(role='Accounts Manager'),
|
||||
dict(role='Auditor')
|
||||
]
|
||||
)).insert()
|
||||
Reference in New Issue
Block a user