Commit 7f3d5c3a authored by Gabriel Davini's avatar Gabriel Davini 🕺🏻

[ADD] Allow superuser to unlink projects.

parent 5894327c
......@@ -23,6 +23,7 @@ import datetime
from openerp import _, api, exceptions, fields, models
from openerp.addons import decimal_precision as dp
from openerp.tools import SUPERUSER_ID
STATE_COLOR_MAP = {
'template': 1,
......@@ -185,8 +186,8 @@ class ProjectProject(models.Model):
return super(ProjectProject, self).create(cr, uid, vals, context=context)
def unlink(self, cr, uid, ids, context=None):
flag = self.pool.get('res.users').has_group(cr, uid,
'dpisa_project.dpisa_proj_coordinator_group')
flag = uid == SUPERUSER_ID or self.pool.get('res.users').has_group(
cr, uid, 'dpisa_project.dpisa_proj_coordinator_group')
if flag:
raise exceptions.ValidationError(
'Only user with this access rights (Project Manager) are allowed to unlink project'
......
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