Odoo Help


auto fill salesperson field when creating new customer [Closed]

Hanzo Chin
on 12/6/13, 4:35 PM 2,231 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 12/09/2013 08:07:33


How do I set the salesperson field in res.partner to be auto-fill with logger ID?


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 12/7/13, 11:25 AM

_defaults is used to set a value by default.

To set current user's id try the following code:

_defaults = {
    'your_field_name' : lambda obj, cr, uid, context: uid,

Hope this will help you.

sorry for my bad, where to set it for res.partner? in res_partner.py?

Hanzo Chin
on 12/8/13, 10:34 AM

If you are not creating your custom module then you can add this code in res.partner object.

Sudhir Arya (ERP Harbor Consulting Services)
on 12/9/13, 12:41 AM
Ashif Abdulrahman
On 12/9/13, 3:23 AM

use this in your _defaults

_defaults = {
      'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c)

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 12/6/13, 4:35 PM
Seen: 2231 times
Last updated: 3/16/15, 8:10 AM