top of page

Odoo - Bypass record rule in the python codes

Writer's picture: Tek Siong, HockTek Siong, Hock

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)



12 views0 comments

Recent Posts

See All

Comentarios


Subscribe Form

  • facebook
  • linkedin

©2019 by Excelroot Technology Sdn Bhd.

bottom of page