Patch to give permission to Accounts Manager to Lease Agreement
diff --git a/accounts/doctype/lease_agreement/lease_agreement.txt b/accounts/doctype/lease_agreement/lease_agreement.txt
index 6fe06bf..1d35a10 100644
--- a/accounts/doctype/lease_agreement/lease_agreement.txt
+++ b/accounts/doctype/lease_agreement/lease_agreement.txt
@@ -5,21 +5,21 @@
 	{
 		'creation': '2011-07-22 17:47:57',
 		'docstatus': 0,
-		'modified': '2011-07-25 06:36:04',
+		'modified': '2011-07-27 12:54:48',
 		'modified_by': 'Administrator',
 		'owner': 'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
-		'_last_update': '1311348373',
+		'_last_update': '1311555967',
 		'colour': 'White:FFF',
 		'doctype': 'DocType',
 		'module': 'Accounts',
 		'name': '__common__',
 		'section_style': 'Simple',
 		'show_in_menu': 0,
-		'version': 19
+		'version': 20
 	},
 
 	# These values are common for all DocField
@@ -38,8 +38,7 @@
 		'parent': 'Lease Agreement',
 		'parentfield': 'permissions',
 		'parenttype': 'DocType',
-		'read': 1,
-		'role': 'Accounts User'
+		'read': 1
 	},
 
 	# DocType, Lease Agreement
@@ -55,6 +54,7 @@
 		'doctype': 'DocPerm',
 		'idx': 1,
 		'permlevel': 0,
+		'role': 'Accounts User',
 		'submit': 1,
 		'write': 1
 	},
@@ -63,7 +63,28 @@
 	{
 		'doctype': 'DocPerm',
 		'idx': 2,
-		'permlevel': 1
+		'permlevel': 1,
+		'role': 'Accounts User'
+	},
+
+	# DocPerm
+	{
+		'cancel': 1,
+		'create': 1,
+		'doctype': 'DocPerm',
+		'idx': 3,
+		'permlevel': 0,
+		'role': 'Accounts Manager',
+		'submit': 1,
+		'write': 1
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'idx': 4,
+		'permlevel': 1,
+		'role': 'Accounts Manager'
 	},
 
 	# DocField
diff --git a/patches/patch.py b/patches/patch.py
index bd726e5..0ceb2a7 100644
--- a/patches/patch.py
+++ b/patches/patch.py
@@ -1341,3 +1341,8 @@
 		reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows')
 
 		reload_doc('accounts', 'Module Def', 'Accounts')
+	elif patch_no == 331:
+		p = get_obj('Patch Util')
+		# permission
+		p.add_permission('Lease Agreement', 'Accounts Manager', 0, read = 1, write=1,submit=1, cancel=1,amend=1)
+		p.add_permission('Lease Agreement', 'Accounts Manager', 1, read = 1)