Community mailing list archives

[v9] : Call do_search_read as admin user from controller

Yassine TEIMI
- 09/14/2016 10:45:17

I'm overriding search_read like the following :

Images intégrées 1

I want to call do_search_read as admin user.

I tried :

super(PFPDataset, self.sudo())do_search_read(model, fields, offset, limit, domain, sort)

and :

super(PFPDataset, self)do_search_read(model.sudo(), fields, offset, limit, domain, sort)

But it's not working. My purpose is to bypass record rules when it's admin user.

How to perform self.sudo() from a controller ?

Thanks a lot.


Yassine TEIMI

Consultant & Odoo Project Manager
TEL : +212 6-87 71 41 18