Well.. you are looking at wrong data..
In odoo/openerp resource_resource contains(actualy is hr_employee name i related to this field)
the name for employees, not users..
there is a table res_users where some user data is stored... (login, password, mail.. etc..) and a relation to res_partner (partner_id) wich contains actual name of user, along with other data (address, phone , mail....)
So eather you rewrite your sql acordingly (using some joins for foreign key ids..) ,
or.. simply user orm methods like.. if you want to search for user wich has login : 'someuser' it would look like:
ids = self.pool.get('res.users').search(cr, uid, [('login'.'=','someuser')]) #expecting a list of ids returned
now that you have list of ids, you can browse those records and read/modify any data stored in fields...
but in your case... i think it would be much easier if you do not use fields.selection.. but instead,
define your:
_columns = {
...
'my_user':fields.many2one('res.users','User'),
...
}
this is common usage for many to one field, and it preserves most orm methods in it ( addins and modifying user)
in case you want to show just a selection on the view... define a view like: (addon after comment:)
<field name="my_user" widget="selection" />
If you need only a few fields shown and not the default view for related field, define them in the same view like:
<field name="my_user" widget="selection" >
<tree>
<field name="first_name"/>
<filed name="last_name"/>
</tree>
</field>
Thank you * Bole [1] *for your answer. I know about "'my_user':fields.many2one('res.users','User')", but the problem is that it displays too much info, such as "Language, Login and date". But i need only first and last name [1] https://www.odoo.com/forum/help-1/user/6104
o, so create a new view that shows only the fields you need .. in xml do like: that should do the trick of custom tree view fro many 2 one;) also you can define custom form view;) the same way
i have edited my answer so now you have example on how to show only the fields you want , and not all of them ;)