addchild will never save added doc

This commit is contained in:
Anand Doshi
2012-12-24 17:02:38 +05:30
parent acc36be87f
commit f5d90abe92
27 changed files with 386 additions and 376 deletions

View File

@@ -239,13 +239,13 @@ class DocType:
def add_roles(self, pr):
roles_list = ['Accounts Manager', 'Accounts User', 'Blogger', 'HR Manager', 'HR User', 'Maintenance User', 'Maintenance Manager', 'Material Manager', 'Material User', 'Material Master Manager', 'Manufacturing Manager', 'Manufacturing User', 'Projects User', 'Purchase Manager', 'Purchase User', 'Purchase Master Manager', 'Quality Manager', 'Sales Manager', 'Sales User', 'Sales Master Manager', 'Support Manager', 'Support Team', 'System Manager', 'Website Manager']
for r in roles_list:
d = addchild(pr, 'userroles', 'UserRole', 1)
d = addchild(pr, 'userroles', 'UserRole')
d.role = r
d.save(1)
# Add roles to Administrator profile
pr = Document('Profile','Administrator')
for r in roles_list:
d = addchild(pr,'userroles', 'UserRole', 1)
d = addchild(pr,'userroles', 'UserRole')
d.role = r
d.save(1)