Browse Source

[FIX] partner_firstname name not editable in user view

pull/2/head
Yannick Vaucher 12 years ago
committed by Guewen Baconnier
parent
commit
699e01d5af
  1. 7
      partner_firstname/__openerp__.py
  2. 3
      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 The field 'name' becomes a stored function field concatenating lastname, firstname
""", """,
'version': '1.0',
'version': '1.0.1',
'author': 'Camptocamp', 'author': 'Camptocamp',
'category': 'MISC', 'category': 'MISC',
'website': 'http://www.camptocamp.com', 'website': 'http://www.camptocamp.com',
'depends': ['base'], 'depends': ['base'],
'data': ['partner_view.xml'],
'data': [
'partner_view.xml',
'res_user_view.xml',
],
'demo': [], 'demo': [],
'test': [], 'test': [],
'auto_install': False, 'auto_install': False,

3
partner_firstname/res_user.py

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