Browse Source

[FIX] partner_firstname name not editable in user view

pull/2/head
Yannick Vaucher 12 years ago
parent
commit
331b2a4c64
  1. 7
      partner_firstname/__openerp__.py
  2. 7
      partner_firstname/res_user.py
  3. 15
      partner_firstname/res_user_view.xml

7
partner_firstname/__openerp__.py

@ -23,12 +23,15 @@
The field 'name' becomes a stored function field concatenating lastname, firstname
""",
'version': '1.0',
'version': '1.0.1',
'author': 'Camptocamp',
'category': 'MISC',
'website': 'http://www.camptocamp.com',
'depends': ['base'],
'data': ['partner_view.xml'],
'data': [
'partner_view.xml',
'res_user_view.xml',
],
'demo': [],
'test': [],
'auto_install': False,

7
partner_firstname/res_user.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
@ -27,5 +27,6 @@ class ResUsers(orm.Model):
_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)
if not 'name' in vals or not vals['name']:
vals['name'] = vals['login']
return super(ResUsers, self).create(cursor, uid, vals, context=context)

15
partner_firstname/res_user_view.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form.firstname</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="readonly">False</attribute>
</field>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save