add stock report permission for accounts manager
This commit is contained in:
parent
d7774d0ab0
commit
38ab4ae3ac
@ -537,4 +537,8 @@ patch_list = [
|
||||
'patch_module': 'patches.august_2012',
|
||||
'patch_file': 'reload_stock_ledger',
|
||||
},
|
||||
]
|
||||
{
|
||||
'patch_module': 'patches.september_2012',
|
||||
'patch_file': 'stock_report_permissions_for_accounts',
|
||||
},
|
||||
]
|
||||
|
0
erpnext/patches/september_2012/__init__.py
Normal file
0
erpnext/patches/september_2012/__init__.py
Normal file
@ -0,0 +1,17 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.model.doc import addchild
|
||||
from webnotes.model.code import get_obj
|
||||
|
||||
for parent in ("Stock Ledger Entry", "Bin"):
|
||||
existing = webnotes.conn.sql("""select role from `tabDocPerm`
|
||||
where permlevel=0 and parent=%s""", (parent,))
|
||||
|
||||
if "Accounts Manager" not in map(lambda x: x[0], existing):
|
||||
doctype_obj = get_obj("DocType", parent, with_children=1)
|
||||
ch = addchild(doctype_obj.doc, "permissions", "DocPerm")
|
||||
ch.permlevel = 0
|
||||
ch.role = "Accounts Manager"
|
||||
ch.read = 1
|
||||
ch.save()
|
||||
|
Loading…
x
Reference in New Issue
Block a user