Community mailing list archives

community@mail.odoo.com

[v9] : Call do_search_read as admin user from controller

by
Yassine TEIMI
- 09/14/2016 10:45:17
Dears,

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.
--

Cordialement

Yassine TEIMI

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