From 854b48096f8695cfc57a039fce899a0cc5a58d18 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 17 Oct 2008 12:05:50 +0200 Subject: [PATCH] improve bzr revid: christophe@tinyerp.com-20081017100550-22lqibto3fa7ajgx --- bin/addons/base/ir/ir_model.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index e357f460591..0f8ec24a8a4 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -294,6 +294,14 @@ class ir_model_access(osv.osv): " WHERE m.model = %s AND a.group_id = %d", (model_name, group_id) ) r = cr.fetchone() + if r is None: + cr.execute("SELECT perm_" + mode + " " + " FROM ir_model_access a " + " JOIN ir_model m ON (m.id = a.model_id) " + " WHERE m.model = %s AND a.group_id IS NULL", (model_name, ) + ) + r = cr.fetchone() + return bool(r and r[0]) def check(self, cr, uid, model, mode='read', raise_exception=True):