Skip to Content
Menu
This question has been flagged
2 Replies
1995 Views

Hi everyone,

I have spent a lot of time to get all individuals of companies with a certain condition (category_id == 'Services'). I am not sure if filter or search functions are appropriate for it. Do you have any idea how to solve this challenge? 

Thank you in advance! 

Avatar
Discard
Best Answer

Hello Erik,

May be I'm not sure but you are talking about filter and search in view side right?

you may use this code for your query:-



company.wise.category_id.filter
model.name












Your Action Name
ir.actions.act_window
model.name
form
tree,kanban,form,calendar,pivot,graph,activity

{"search_default_company":1,"search_default_category_id":1}



Avatar
Discard
Best Answer

you need to add sudo() before search to get all individual in the db not current DB 
so you may write it like taht 
individuals = self.env['res.partner'].sudo().search([(category_id == 'Services'),('parent_id','!=',False)])

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 23
1214
1
Aug 21
1233
1
Apr 21
2417
0
Apr 21
1379
7
Apr 21
18382