Browse Source

[FIX] user creation from res_user form

pull/487/head
unknown 12 years ago
committed by Enric Tobella
parent
commit
4e2e2abdef
  1. 1
      partner_firstname/__init__.py
  2. 31
      partner_firstname/res_user.py

1
partner_firstname/__init__.py

@ -18,3 +18,4 @@
#
##############################################################################
from . import partner
from . import res_user

31
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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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)
Loading…
Cancel
Save