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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
a7a7d7c3
Commit
a7a7d7c3
authored
Jun 12, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base: initialize site when creating user preferences
same as group
parent
25d831a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_createUserPreference.py
...tem/portal_skins/erp5_base/Person_createUserPreference.py
+3
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
...tTemplateItem/portal_components/test.erp5.testERP5Base.py
+5
-1
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_createUserPreference.py
View file @
a7a7d7c3
...
...
@@ -23,5 +23,8 @@ for assignment in context.contentValues(portal_type='Assignment'):
if
group
:
preference
.
setPreferredSectionCategory
(
group
)
preference
.
setPreferredAccountingTransactionSectionCategory
(
group
)
site
=
assignment
.
getSite
(
base
=
True
)
if
site
:
preference
.
setPreferredNodeCategory
(
site
)
return
preference
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
View file @
a7a7d7c3
...
...
@@ -1153,7 +1153,8 @@ class TestERP5Base(ERP5TypeTestCase):
def
test_user_creation
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'nexedi/storever'
)
group
=
'nexedi/storever'
,
site
=
'distibution/tokyo'
)
self
.
assertNotEquals
(
None
,
assignment
.
getGroupValue
())
assignment
.
open
()
self
.
portal
.
portal_workflow
.
doActionFor
(
person
,
'create_user_action'
,
...
...
@@ -1182,6 +1183,9 @@ class TestERP5Base(ERP5TypeTestCase):
# for his assignment group
self
.
assertEqual
(
'group/nexedi/storever'
,
self
.
portal
.
portal_preferences
.
getPreferredSectionCategory
())
# and assignment function
self
.
assertEqual
(
'site/distibution/tokyo'
,
self
.
portal
.
portal_preferences
.
getPreferredNodeCategory
())
def
test_default_address_acquisition
(
self
):
# more complete version of test_04_SubordinationAndAddress
...
...
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