Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7746 มุมมอง

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>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ธ.ค. 24
1385
3
มิ.ย. 16
9328
1
พ.ค. 16
6334
res.users filteration in odoo 11 แก้ไขแล้ว
1
พ.ย. 22
4155
Hide or remove button added by xpath แก้ไขแล้ว
8
ต.ค. 22
32793