[FIX] res_users: side-effect of virtual groups prevented users from saving their prefs

lp bug: https://launchpad.net/bugs/904626 fixed

bzr revid: odo@openerp.com-20111215120741-1lne9fjs67d7c42k
This commit is contained in:
Olivier Dony 2011-12-15 13:07:41 +01:00
parent 63296c0142
commit 86f2aef370
1 changed files with 5 additions and 2 deletions

View File

@ -828,8 +828,11 @@ class users_view(osv.osv):
selected = values.pop(f)
if selected:
add.append(selected)
# remove groups in 'remove' and add groups in 'add'
values['groups_id'] = [(3, id) for id in remove] + [(4, id) for id in add]
# update values *only* if groups are being modified, otherwise
# we introduce spurious changes that might break the super.write() call.
if add or remove:
# remove groups in 'remove' and add groups in 'add'
values['groups_id'] = [(3, id) for id in remove] + [(4, id) for id in add]
def default_get(self, cr, uid, fields, context=None):
group_fields, fields = partition(is_reified_group, fields)