Skip to content
Snippets Groups Projects
user avatar
Luis González authored
Currently, when searching a partner through a related record using
`sudo()`, the superuser privileges are used when searching the record,
but not when searching the related partner. That's because the su flag
is lost during the call to with_user, even if it was to keep the same
user.

For instance, a code like the following wouldn't work if the current
user has no enough rights (e.g. the public user):

    self.sudo().search([('partner_id', 'ilike', 'John Doe')])

To solve the above, the with_user is called only when a specific
name_get_uid is given, as done in the _search implementation.

closes odoo/odoo#97920

X-original-commit: e5e12681437ae562517cc058e4ce0fab90cd0ae7
Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
12dc06eb
History

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials