Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3359 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

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