From d89ce278a2e5fe2f343b52c2ab6f6cb79982ffb9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Feb 2013 21:58:07 +0100 Subject: [PATCH] [FIX] user creation from res_user form --- partner_firstname/__init__.py | 1 + partner_firstname/res_user.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 partner_firstname/res_user.py diff --git a/partner_firstname/__init__.py b/partner_firstname/__init__.py index 0df41cead..ec7a9bae4 100644 --- a/partner_firstname/__init__.py +++ b/partner_firstname/__init__.py @@ -18,3 +18,4 @@ # ############################################################################## from . import partner +from . import res_user diff --git a/partner_firstname/res_user.py b/partner_firstname/res_user.py new file mode 100644 index 000000000..71cf38c1f --- /dev/null +++ b/partner_firstname/res_user.py @@ -0,0 +1,31 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Author: Nicolas Bessi. Copyright Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from openerp.osv import orm + + +class ResUsers(orm.Model): + """Allows user creation from user form as + name is not in form""" + + _inherit = 'res.users' + + def create(self, cursor, uid, vals, context=None): + vals['name'] = vals['login'] + return super(ResUsers, self).create(cursor, uid, vals, context=context) \ No newline at end of file