Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How Get A Current Login User Name ?

By
sunil
on 8/22/13, 10:01 AM 3,781 views

How Get A Current Login User Name in Textbox when Any Form Load time?

3

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 8/22/13, 10:08 AM

In the default method Get User Name

    def _get_user_name(self, cr, uid, *args):
        user_obj = self.pool.get('res.users')
        user_value = user_obj.browse(cr, uid, uid)
        return user_value.login or False

  _defaults = {   
        'user_id: _get_user_name,
        }

Thanks Prakash! This has helped me a lot :) Upvoted.

Yenthe
on 1/19/15, 6:04 AM
2

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 2/23/16, 11:07 PM
define user_id as many2one (res.users)


_defaults = { 'user_id': lambda obj, cr, uid, ctx=None: uid,}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/22/13, 10:01 AM
Seen: 3781 times
Last updated: 2/23/16, 11:07 PM