Hello,
public_user = self.env.ref('base.public_user')
public_book = self.env['library.book'].with_user(public_user)
public_book.search([('name', 'ilike', 'cookbook')])
i want to ask that why we use with_user() and public_user what is the advantage of using this. can someone please explain . thanks