Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Company dependent field - impossible use as related in multicompany environments #9450

Closed
zbik2607 opened this issue Nov 6, 2015 · 3 comments

Comments

@zbik2607
Copy link
Contributor

zbik2607 commented Nov 6, 2015

Example to reproduction:

  1. Define:

class res_partner(models.Model):
_inherit = 'res.partner'
foo = fields.Boolean(string='FOO', related='property_account_receivable.active')

or define:

foo = fields.Boolean(string='FOO', company_dependent=True, related='property_account_receivable.active')

  1. In children company, as children company user (with max access rights) create new Customer

Result:
AccessError: The requested operation cannot be completed due to security restrictions. Please contact your system administrator. (Document type: res.users, Operation: read)
Expected:
Create and read new Customer.

@zbik2607 zbik2607 changed the title Company dependent field - impossible use as related in multicompany environments [8.0] Company dependent field - impossible use as related in multicompany environments Nov 6, 2015
@alexis-via
Copy link
Contributor

I hit the same kind of issue with code like this one:
https://github.com/OCA/l10n-france/blob/8.0/l10n_fr_siret/company.py
A related store=True field that go from res.partner which doesn't have company_id field (therefore, no multi-company record rule), to res.company that has a record rule.

I seems that related field are computed with the rights of the user, where as they should be computed with sudo() rights to by-pass the record rules.

@clonedagain
Copy link

Can you make an automatic test please?

@Yenthe666
Copy link
Collaborator

Hi @zbik2607,

Thank you for your bug report and our apoligies that we haven't had the time to look at this bug report. We do our best to handle all of them, but we sometimes miss some.
At this point Odoo 8 is no longer supported as Odoo only supports three versions (9.0, 10.0, 11.0 at the moment).
If you can still reproduce this issue on Odoo 9, Odoo 10 or Odoo 11 we encourage you to create a new bug report.

Regards,
Yenthe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants