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.

0

how to make show particular record in many2one field?

By
Demirel yakito
on 2/17/15, 2:13 AM 1,288 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
4

Akhil P Sivan

--Akhil P Sivan--
3423
| 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)])

works.

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

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
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
2

aneesh ATEES Infomedia Pvt Ltd

--aneesh ATEES Infomedia Pvt Ltd--
765
| 5 1 6
Thrissur, India
--aneesh ATEES Infomedia Pvt Ltd--

9995074692

aneesh ATEES Infomedia Pvt Ltd
On 2/17/15, 3:28 AM

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

domain=[('field_name','=',True)])

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: 2/17/15, 2:13 AM
Seen: 1288 times
Last updated: 8/25/15, 11:38 AM