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
142
Merge Requests
142
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
280b6f13
Commit
280b6f13
authored
Nov 10, 2014
by
Klaus Wölfel
Committed by
Xiaowu Zhang
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup! ERP5Configurator: Add generic configurator item for setting values of properties
parent
dbe15335
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
product/ERP5Configurator/Document/PathConfiguratorItem.py
product/ERP5Configurator/Document/PathConfiguratorItem.py
+10
-5
product/ERP5Configurator/Document/ValueConfiguratorItem.py
product/ERP5Configurator/Document/ValueConfiguratorItem.py
+1
-1
No files found.
product/ERP5Configurator/Document/PathConfiguratorItem.py
View file @
280b6f13
...
...
@@ -60,16 +60,21 @@ class PathConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def
_checkConsistency
(
self
,
fixit
=
False
,
filter
=
None
,
**
kw
):
portal
=
self
.
getPortalObject
()
error_list
=
[]
for
container_path
,
document_dict
,
transition_method
in
iter
(
self
.
getConfigurationListList
()):
for
container_path
,
transition_method
,
document_dict
in
iter
(
self
.
getConfigurationListList
()):
document_dict
=
document_dict
.
copy
()
document_id
=
document_dict
.
pop
(
'id'
)
portal_type
=
document_dict
.
pop
(
'portal_type'
)
container
=
portal
.
unrestrictedTraverse
(
container_path
,
None
)
if
container
is
not
None
:
document
=
getattr
(
container
,
document_
dict
[
'id'
]
,
None
)
document
=
getattr
(
container
,
document_
id
,
None
)
if
document
is
None
:
error_list
.
append
(
self
.
_createConstraintMessage
(
"%s %s should be created"
%
(
document_dict
[
'id'
],
document_dict
[
'portal_type'
])))
"%s %s should be created"
%
(
portal_type
,
document_id
)))
if
fixit
:
document
=
container
.
newContent
(
**
document_dict
)
document
=
container
.
newContent
(
id
=
document_id
,
portal_type
=
portal_type
)
for
property_id
,
value
in
document_dict
.
items
():
document
.
setProperty
(
property_id
,
value
)
if
transition_method
is
not
None
:
getattr
(
document
,
transition_method
)
(
comment
=
translateString
(
"Transition executed by Configurator"
))
...
...
product/ERP5Configurator/Document/ValueConfiguratorItem.py
View file @
280b6f13
...
...
@@ -65,7 +65,7 @@ class ValueConfiguratorItem(ConfiguratorItemMixin, XMLObject):
configuration_dict
.
get
,(
'search_dict'
,
'relative_path'
,
'property_value_dict'
))
if
search_dict
is
not
None
:
document
=
self
.
portal_catalog
.
getResultValue
(
search_dict
)
document
=
self
.
portal_catalog
.
getResultValue
(
**
search_dict
)
else
:
document
=
portal
if
relative_path
is
not
None
and
document
is
not
None
:
...
...
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