Commit 29577a29 authored by Gabriel Davini's avatar Gabriel Davini 🕺🏻

[FIX] Fix previous commit

parent 7f3d5c3a
......@@ -185,15 +185,15 @@ class ProjectProject(models.Model):
return super(ProjectProject, self).create(cr, uid, vals, context=context)
def unlink(self, cr, uid, ids, context=None):
flag = uid == SUPERUSER_ID or self.pool.get('res.users').has_group(
cr, uid, 'dpisa_project.dpisa_proj_coordinator_group')
if flag:
def unlink(self):
if self.env.uid != SUPERUSER_ID or\
not self.env.user.has_group('dpisa_project.dpisa_proj_coordinator_group'):
raise exceptions.ValidationError(
'Only user with this access rights (Project Manager) are allowed to unlink project'
return super(ProjectProject, self).unlink(cr, uid, ids, context=context)
return super(ProjectProject, self).unlink()
def _calc_task_count(self):
query = """
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment