From 5561c46196efb1dce6c2c805d5c6ec40dd0bd1dd Mon Sep 17 00:00:00 2001
From: rpa-openerp <>
Date: Tue, 3 Nov 2009 12:16:36 +0530
Subject: [PATCH] [IMP]able to pass context into record tag in xml file and
pass context {"noadmin":True} in extended group data for not allocate that
group to admin user
bzr revid: hmo@tinyerp.com-20091103064636-0v855wtnh06l0zop
---
bin/addons/base/res/res_user.py | 17 +++++++++--------
bin/addons/base/security/base_security.xml | 6 +++---
bin/import_xml.rng | 1 +
bin/tools/convert.py | 5 ++++-
4 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py
index 49334986c94..5b610096012 100644
--- a/bin/addons/base/res/res_user.py
+++ b/bin/addons/base/res/res_user.py
@@ -60,14 +60,15 @@ class groups(osv.osv):
if vals['name'].startswith('-'):
raise osv.except_osv(_('Error'),
_('The name of the group can not start with "-"'))
- gid = super(groups, self).create(cr, uid, vals, context=context)
-
- # assign this new group to user_root
- user_obj = self.pool.get('res.users')
- aid = user_obj.browse(cr, 1, user_obj._get_admin_id(cr))
- if aid:
- aid.write({'groups_id': [(4, gid)]})
-
+ gid = super(groups, self).create(cr, uid, vals, context=context)
+ if context and context.get('noadmin', False):
+ pass
+ else:
+ # assign this new group to user_root
+ user_obj = self.pool.get('res.users')
+ aid = user_obj.browse(cr, 1, user_obj._get_admin_id(cr))
+ if aid:
+ aid.write({'groups_id': [(4, gid)]})
return gid
groups()
diff --git a/bin/addons/base/security/base_security.xml b/bin/addons/base/security/base_security.xml
index df1027eaa50..85590610692 100644
--- a/bin/addons/base/security/base_security.xml
+++ b/bin/addons/base/security/base_security.xml
@@ -17,15 +17,15 @@
Employee
-
+
Useability / Extended View
-