[IMP] res_user: fix default_get; add default groups on simplified view
bzr revid: chm@openerp.com-20130227085023-q8mwozccystgf23a
This commit is contained in:
parent
7bdcf8817f
commit
3b6e76f5b4
|
@ -787,8 +787,9 @@ class users_view(osv.osv):
|
|||
# add "default_groups_ref" inside the context to set default value for group_id with xml values
|
||||
if 'groups_id' in fields and isinstance(context.get("default_groups_ref"), list):
|
||||
groups = []
|
||||
ir_model_data = self.pool.get('ir.model.data')
|
||||
for group_xml_id in context["default_groups_ref"]:
|
||||
group_split = group.split('.')
|
||||
group_split = group_xml_id.split('.')
|
||||
if len(group_split) != 2:
|
||||
raise osv.except_osv(_('Invalid context value'), _('Invalid context default_groups_ref value (model.name_id) : "%s"') % group)
|
||||
temp, group_id = ir_model_data.get_object_reference(cr, uid, group_split[0], group_split[1]);
|
||||
|
|
|
@ -108,10 +108,11 @@
|
|||
<separator/>
|
||||
<div>
|
||||
You are creating a new user.
|
||||
<span invisible="not context.get('default_groups_ref',False)">
|
||||
This user will have the access rights to be able to do the task assigned to it. You can see this list of groups of access rights on the field of the form view.
|
||||
</span>
|
||||
You should use the "Settings > Users" menu to change his access rights and other settings.
|
||||
<div invisible="not context.get('default_groups_ref')">
|
||||
This user will have the access rights to be able to do the task assigned to it:
|
||||
<field name="groups_id" readonly="1" widget="many2many_tags" style="display: inline;"/>
|
||||
</div>
|
||||
</div>
|
||||
<group>
|
||||
<field name="phone" placeholder="e.g. +32.81.81.37.00"/>
|
||||
|
|
Loading…
Reference in New Issue