From 5ca4fbce7f88ace6a41a4e6ba328068883fee985 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 10 Jan 2011 11:37:14 +0100 Subject: [PATCH] [FIX] base: do force the values in when copy()ing res.users bzr revid: chs@openerp.com-20110110103714-orj5jiovz5ua7ozs --- bin/addons/base/res/res_user.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index 64544742186..519cb47ff57 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -3,6 +3,7 @@ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). +# Copyright (C) 2010-2011 OpenERP s.a. (). # # 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)