From 4c97f3fabbdfffc42903bb2bed29f7104f5fc9df Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Feb 2012 12:04:14 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=C2=A0in=20delete=20function=20report=20pr?= =?UTF-8?q?otector=20(lp:c2c-addons/6.1=20=20rev=2028.1.4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- security_protector/security_protector.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/security_protector/security_protector.py b/security_protector/security_protector.py index 170739ebd..b082d16f4 100644 --- a/security_protector/security_protector.py +++ b/security_protector/security_protector.py @@ -32,15 +32,16 @@ class IrModelAccess(osv.osv): def unlink(self, cr, uid, ids, context=None): res = True context = context or {} - if self._acces_can_be_modified(cr, uid, context=context): - res = super(IrModelAccess, self).write(cr, uid, ids, context=context) - else: # I'm note sur about this one maybe we should do nothing - self.write(cr, uid, args[0], - {'perm_read':False, - 'perm_write': False, - 'perm_unlink': False, - 'perm_create': False}, - context={context}) + # I'm note sur about this one maybe we should do nothing + if self._acces_can_be_modified(cr, uid, context=context): + vals = {'perm_read':False, + 'perm_write': False, + 'perm_unlink': False, + 'perm_create': False} + super(IrModelAccess, self).write(cr, uid, ids, vals, context=context) + else: + res = super(IrModelAccess, self).unlink(cr, uid, ids, context=context) + return res IrModelAccess() \ No newline at end of file