Odoo Help

0

How to filter the list of users in Many2one filed ?

By
Zakaria
on 6/19/17, 8:34 AM 86 views

Hello my friends,

I have defined a field in my class which show me the list of users in the database:


But i want to show only a certain type of users where the connected user have type "A", and certain type of users where the conncted user have type "B".

Can i filer a field using rule ? how i can realize that ? Thank you for help

0
Zakaria
On 6/19/17, 10:31 AM

Thank you @EmanuelCino. My question was as follows:

If a connected user is a "manager" he should see only "workers" in the user field (the list of users)

And if the user is "Admin" he will should see only " managers in the user field.


How i can filer the user_id field so ?

Hi Zak,

can you tell the exact criteria ?

Niyas Raphy
on 6/19/17, 11:04 AM

Hi Niyas i want to filter my many2one field;

I have this field which allows me to display and choose the users ( to assign each object to each user ) : approved_by = fields.Many2one('res.users', 'Affecter à')

And i have 3 users groups : Admin and manager and worker

When the manager connect he should see only users in the user field

And when the Admin connect he should see only manager in the user field

Zakaria
on 6/19/17, 11:13 AM
0
Emanuel Cino
On 6/19/17, 10:05 AM

Here should be your field definition :

user_id = fields.Many2one('res.users', 'User', domain=['|', ('type', '=', 'A'), '&', ('type', '=', 'B'), ('criteria_to_show_type_b', '=', 'value_of criteria')]]

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: 6/19/17, 8:34 AM
Seen: 86 times
Last updated: 6/19/17, 10:31 AM