Skip to Content
Menu
This question has been flagged
1 Reply
2882 Views

I'm trying to add a filter to a search view to filter the records based on the current company.

The model is not company_dependant.

I've tried with

<filter name="main_company_filter" string="Current company" domain="[('main_company_id','=',uid.company_id)]/>

but it throws an error.

Any suggestion?

Thanks in advance.

Avatar
Discard
Best Answer

Hi,

Update the module with this XML code:

<filter name="main_company_filter" string="Current company" domain="[('main_company_id', 'child_of' ,user.company_id.id)]"/>

Regards

Avatar
Discard
Author

I'm testing on V13 and It gives me the error "Field 'user' used in attributes must be present in view but is missing"