تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7471 أدوات العرض

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
ديسمبر 24
989
3
يونيو 16
8801
1
مايو 16
5746
1
نوفمبر 22
3818
8
أكتوبر 22
31990