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

G2P-2060 Fixed Odoo server error when trying to assign multiple roles to a member within a group. #135

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions g2p_registry_base/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
4 changes: 2 additions & 2 deletions g2p_registry_membership/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def write(self, values):
if self:
unique_kinds = self.env["g2p.group.membership.kind"].search([("is_unique", "=", True)])
for unique_kind in unique_kinds:
count = sum(1 for rec in self.group_membership_ids if rec.kind.id == unique_kind.id)
count = sum(1 for rec in self.group_membership_ids if unique_kind.id in rec.kind.ids)
if count > 1:
raise ValidationError(_("Only one %s is allowed per group") % unique_kind.name)
return res
Expand All @@ -43,7 +43,7 @@ def create(self, values):
if new_record:
unique_kinds = self.env["g2p.group.membership.kind"].search([("is_unique", "=", True)])
for unique_kind in unique_kinds:
count = sum(1 for rec in new_record.group_membership_ids if rec.kind.id == unique_kind.id)
count = sum(1 for rec in self.group_membership_ids if unique_kind.id in rec.kind.ids)
if count > 1:
raise ValidationError(_("Only one %s is allowed per group") % unique_kind.name)
return new_record
Expand Down
Loading