Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
bc9b6328
Commit
bc9b6328
authored
Nov 25, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base: only consider open assignment to initialize preferences
parent
40d752f4
Pipeline
#38538
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_createUserPreference.py
...tem/portal_skins/erp5_base/Person_createUserPreference.py
+2
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
...tTemplateItem/portal_components/test.erp5.testERP5Base.py
+6
-0
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_createUserPreference.py
View file @
bc9b6328
...
@@ -19,6 +19,8 @@ preference.setTitle(translateString('Preference for ${name}',
...
@@ -19,6 +19,8 @@ preference.setTitle(translateString('Preference for ${name}',
mapping
=
dict
(
name
=
context
.
getTitle
())))
mapping
=
dict
(
name
=
context
.
getTitle
())))
for
assignment
in
context
.
contentValues
(
portal_type
=
'Assignment'
):
for
assignment
in
context
.
contentValues
(
portal_type
=
'Assignment'
):
if
assignment
.
getValidationState
()
!=
'open'
:
continue
group
=
assignment
.
getGroup
(
base
=
True
)
group
=
assignment
.
getGroup
(
base
=
True
)
if
group
:
if
group
:
preference
.
setPreferredSectionCategory
(
group
)
preference
.
setPreferredSectionCategory
(
group
)
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
View file @
bc9b6328
...
@@ -1309,6 +1309,12 @@ class TestERP5Base(ERP5TypeTestCase):
...
@@ -1309,6 +1309,12 @@ class TestERP5Base(ERP5TypeTestCase):
site
=
'distibution/tokyo'
)
site
=
'distibution/tokyo'
)
self
.
assertNotEqual
(
None
,
assignment
.
getGroupValue
())
self
.
assertNotEqual
(
None
,
assignment
.
getGroupValue
())
assignment
.
open
()
assignment
.
open
()
# unrelated assignment that should be ignored
person
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'nexedi/rentalinux'
,
site
=
'distibution/new_york'
,
)
login
=
person
.
newContent
(
login
=
person
.
newContent
(
portal_type
=
"ERP5 Login"
,
portal_type
=
"ERP5 Login"
,
reference
=
"user_login"
,
reference
=
"user_login"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment