Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
0
Merge Requests
0
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
Romain Courteaud
erp5_rtl_support
Commits
79523eee
Commit
79523eee
authored
Jul 07, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type.constructInstance: simplify code
parent
3dbabf8a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+2
-6
No files found.
product/ERP5Type/ERP5Type.py
View file @
79523eee
...
...
@@ -353,7 +353,8 @@ class ERP5TypeInformation(XMLObject,
security
.
declarePublic
(
'constructInstance'
)
def
constructInstance
(
self
,
container
,
id
,
created_by_builder
=
0
,
temp_object
=
0
,
compute_local_role
=
None
,
notify_workflow
=
True
,
**
kw
):
notify_workflow
=
True
,
is_indexable
=
None
,
activate_kw
=
None
,
reindex_kw
=
None
,
**
kw
):
"""
Build a "bare" instance of the appropriate type in
'container', using 'id' as its id.
...
...
@@ -378,16 +379,11 @@ class ERP5TypeInformation(XMLObject,
# container._setObject(set_owner=True) does.
user_id
=
getCurrentUserIdOrAnonymousToken
()
ob
.
manage_setLocalRoles
(
user_id
,
[
'Owner'
])
for
ignore
in
(
'activate_kw'
,
'is_indexable'
,
'reindex_kw'
):
kw
.
pop
(
ignore
,
None
)
else
:
activate_kw
=
kw
.
pop
(
'activate_kw'
,
None
)
if
activate_kw
is
not
None
:
ob
.
__of__
(
container
).
setDefaultActivateParameters
(
**
activate_kw
)
reindex_kw
=
kw
.
pop
(
'reindex_kw'
,
None
)
if
reindex_kw
is
not
None
:
ob
.
__of__
(
container
).
setDefaultReindexParameters
(
**
reindex_kw
)
is_indexable
=
kw
.
pop
(
'is_indexable'
,
None
)
if
is_indexable
is
not
None
:
ob
.
isIndexable
=
is_indexable
container
.
_setObject
(
id
,
ob
)
...
...
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