Allow copying of res.group.
With this patch, access groups can be duplicated. Solves the 'unique(name)' constraint for the new instance. bzr revid: p_christ@hol.gr-20090421161937-odqnx1ycmwvp04mp
This commit is contained in:
@@ -67,6 +67,14 @@ class groups(osv.osv):
|
||||
|
||||
return gid
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False):
|
||||
group = self.browse(cr, uid, id, context=context)
|
||||
default = default.copy()
|
||||
if not 'name' in default:
|
||||
default['name'] = group['name']
|
||||
default['name'] = default['name'] + _(' (copy)')
|
||||
return super(groups, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
groups()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user