[MERGE] res.users: copy() should heed provided default dict

bzr revid: odo@openerp.com-20110110105829-sj0igyle1huv1ami
This commit is contained in:
Christophe (OpenERP) 2011-01-10 11:58:29 +01:00 committed by Olivier Dony
commit e61b9f4e8c
1 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -28,7 +29,6 @@ import pooler
from tools.translate import _
from service import security
import netsvc
import time
class groups(osv.osv):
_name = "res.groups"
@ -411,11 +411,12 @@ class users(osv.osv):
if default is None:
default = {}
copy_pattern = _("%s (copy)")
default.update(login=(copy_pattern % user2copy['login']),
copydef = dict(login=(copy_pattern % user2copy['login']),
name=(copy_pattern % user2copy['name']),
address_id=False, # avoid sharing the address of the copied user!
)
return super(users, self).copy(cr, uid, id, default, context)
copydef.update(default)
return super(users, self).copy(cr, uid, id, copydef, context)
def context_get(self, cr, uid, context=None):
user = self.browse(cr, uid, uid, context)