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

Paulius11:17.0]FIX]-hide_menu_user-Raises-ValueError #317

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

Paulius11
Copy link

@Paulius11 Paulius11 commented May 30, 2024

Expected-singleton-when-installing-hr_-and-other-extensions, when there multiple list of users
This exception is raised, when:

    rslt = super().write(vals)
  File "/custom_addons/hide_menu_user/models/res_users.py", line 37, in write
    menu.restrict_user_ids = [fields.Command.link(self.id)]
  File "/opt/prod-odoo17/odoo/fields.py", line 5140, in __get__
    raise ValueError("Expected singleton: %s" % record)
ValueError: Expected singleton: res.users(2, 44, 55, 66, 77..,,)

This exception is raised, when:
```
    rslt = super().write(vals)
  File "/custom_addons/hide_menu_user/models/res_users.py", line 37, in write
    menu.restrict_user_ids = [fields.Command.link(self.id)]
  File "/opt/prod-odoo17/odoo/fields.py", line 5140, in __get__
    raise ValueError("Expected singleton: %s" % record)
ValueError: Expected singleton: res.users(2, 46, 41, 43, 44, 48, 8, 40, 39, 47, 7, 49, 6, 45, 42, 9)

```
@Paulius11 Paulius11 changed the title Fix singleton exception for res_users.py Paulius11:17.0]FIX]-hide_menu_user-Raises-ValueError May 30, 2024
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

Successfully merging this pull request may close these issues.

1 participant