Odoo Help

0

how to make show particular record in many2one field?

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

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

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

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.

Register

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

1 follower(s)

Stats

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