Odoo Help


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.


how to make show particular record in many2one field?

Demirel yakito
on 2/17/15, 2:13 AM 1,187 views

i hve one many to one field 'hr.employee', in that i want to list some particular employee data. is this possible in odoo v8?

You mean you want list only employees satisfying a criteria?

Akhil P Sivan
on 2/17/15, 2:21 AM

yes based on condition i want to list particular employee in many2one field.

Demirel yakito
on 2/17/15, 2:23 AM

Akhil P Sivan

--Akhil P Sivan--
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 2/17/15, 2:28 AM

Hi Ramanan,

It is possible in v8. You can use domain attribute in that many2one field, for giving the criteria

For example:

class Session(models.Model):
    _name = 'model.name'
    employee_id = fields.Many2one('hr.employee', string="Employee", domain=[('field_name','=',value)])


Demirel yakito
on 2/17/15, 2:33 AM


| 5 3 8
Pondicherry, India
On 2/17/15, 2:26 AM

you can use domain for that:

<field name="your_many2one_field" domain="[('employee_id','=',employee_id)/>

thnks it's works.

Demirel yakito
on 2/17/15, 2:31 AM
On 2/17/15, 3:28 AM

class Session(models.Model):
    _name = 'model.name'
    employee_id = fields.Many2one('hr.employee', string="Employee",


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)


Asked: 2/17/15, 2:13 AM
Seen: 1187 times
Last updated: 8/25/15, 11:38 AM