diff options
| author | P. Christeas <p_christ@hol.gr> | 2009-04-21 19:19:37 +0300 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2009-04-21 19:19:37 +0300 |
| commit | 02177cd1e00ba3e8d3d8e8debfef19057cb43c2c (patch) | |
| tree | 18b575f42e57658a7188ca41ea15dc2dda5f5efa /bin | |
| parent | e0da6e16d1801fc16f8ac5cb2d82dd21ed5538d0 (diff) | |
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
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/addons/base/res/res_user.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index ec96b07dc0c..31a09135369 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -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() |
