create user permissions on save of employee

This commit is contained in:
Nabin Hait 2018-06-15 13:16:44 +05:30
parent e647c1f3cb
commit 2f89a04511

View File

@ -68,9 +68,7 @@ class Employee(NestedSet):
if not self.create_user_permission: return
if not has_permission('User Permission', ptype='write'): return
if not has_user_permission_for_employee(self.user_id, self.name):
add_user_permission("Employee", self.name, self.user_id)
if not has_user_permission_for_employee(self.user_id, self.company):
set_user_permission_if_allowed("Company", self.company, self.user_id)
def update_user(self):