Hello Odooers, Odoogig and Odoo Lovers,
In this Odoo Tip Tutorial, I would like to explain how to Force update with super user sudo() in Odoo
- Sudo generally means ‘super user do’, its allows super user privilege to user in odoo.
- In odoo there are some access groups, such as Sale / Manager, Purchase / Manager etc.
- And each right has its own accessibility across odoo, means sale manager can do more things in odoo rather than sale user
- So group is one kind of restriction and using sudo() as a developer you can bypass this restriction
- For example ‘sale.config’ is a name of the model and only Sale Manager can access this model
so at backend you can include sudo() in your code so it will not give any warning at front end while ‘sale.config’ is being accessed by Sale User
# without using sudo()
sale_ids = self.env['sale.config'].search()
# with using sudo()
sale_ids = self.env['sale.config'].sudo().search()
GET IN TOUCH.!
We’d Love to Hear from You! We are happy to answer any questions, you have regarding My Training.
Mail : email@example.com
Skype : mayur_maheshwari1
What’s app : +919924542042