[FIX] base: allow to give a name attribute to the res.groups copy method
Before, the name given to the copy method was always 'the old name (copy)' (even bypassing what might have been given to the default values dict). opw 1862214
This commit is contained in:
@@ -145,7 +145,9 @@ class Groups(models.Model):
|
||||
@api.multi
|
||||
def copy(self, default=None):
|
||||
self.ensure_one()
|
||||
default = dict(default or {}, name=_('%s (copy)') % self.name)
|
||||
chosen_name = default.get('name') if default else ''
|
||||
default_name = chosen_name or _('%s (copy)') % self.name
|
||||
default = dict(default or {}, name=default_name)
|
||||
return super(Groups, self).copy(default)
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user