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

i added this field in my custom module

class DailyTarget(models.Model):
_name = 'user.target'
_description = 'User Target'
    agent_id = fields.Many2one('res.partner')

i need to get  only partners in agent_id which are users too.


which are exists in res.users only 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi

Try the following code,

class DailyTarget(models.Model)        

_name = 'user.target'        

_description = 'User Target'

agent_id = fields.Many2one('res.partner', domain=[('user_ids', '!=', False)])  


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
1639
1
เม.ย. 25
3516
1
เม.ย. 25
1094
4
มี.ค. 25
5924
2
ก.พ. 25
1949