top of page
  • Tek Siong, Hock

Odoo - Bypass record rule in the python codes

What are the occasions when you need to bypass the record rule?

a) Certain fields are only accessible by certain group of users (record rule) and if the restricted field value are updated by all users action.


b) User's action will trigger the retrieving of data by search that may have the record rules that are restricted to the user.


The solution is simple by using sudo().

Eg,

self.env['account.invoice'].sudo().search(invoice_domain)



3 views0 comments

Recent Posts

See All
bottom of page