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 do I filter selection from form view?

By
Gavin Yap
on 5/11/16, 9:26 AM 324 views

Hi,


Say I want to select from a list of users from the res.users model that belongs to a certain group.

Below is a snippet of code from my form view showing that I'm trying to use context to filter

<page string="Team">
<div>
<field name="responsible_ids" context="{'default_groups_ref': ['pdm.group_team_member']}"/>
</div>
</page>
0
Jose Vasquez
On 5/11/16, 10:01 AM

Hi Gavin Yap

To filter by user, it is not necessary to place domain, simply the name of your field. Try this.

<search string="Search...">
    <field name="responsible_ids"/>
</search>

Whenever your field this stated as follows:

'resposible_ids' : fields.many2one('res.users', 'Responsible'),
or
resposible_ids = fields.Many2one('res.users', 'Responsible')

I hope to help you, regards.

Hi thanks for your help, but the solution you provide does not answer my question. What I need is that when I select my team for an Object, from the res.users model, I would like to select them from a certain group.

Gavin Yap
on 5/12/16, 3:47 AM

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: 5/11/16, 9:26 AM
Seen: 324 times
Last updated: 5/11/16, 10:01 AM