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
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yusei Tahara
erp5
Commits
d6ffba49
Commit
d6ffba49
authored
May 03, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Rename properties to not have conflicts
parent
3f396373
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+6
-7
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+11
-9
No files found.
product/ERP5/Document/BusinessManager.py
View file @
d6ffba49
...
@@ -339,7 +339,6 @@ class BusinessManager(Folder):
...
@@ -339,7 +339,6 @@ class BusinessManager(Folder):
for
path_item
in
path_item_list
:
for
path_item
in
path_item_list
:
if
'#'
in
str
(
path_item
[
0
]):
if
'#'
in
str
(
path_item
[
0
]):
import
pdb
;
pdb
.
set_trace
()
PathItem
=
self
.
newContent
(
portal_type
=
'Business Property Item'
)
PathItem
=
self
.
newContent
(
portal_type
=
'Business Property Item'
)
# If its a property, no need to resolve the path
# If its a property, no need to resolve the path
PathItem
.
edit
(
PathItem
.
edit
(
...
@@ -922,18 +921,18 @@ class BusinessPropertyItem(XMLObject):
...
@@ -922,18 +921,18 @@ class BusinessPropertyItem(XMLObject):
obj
=
p
.
unrestrictedTraverse
(
relative_url
)
obj
=
p
.
unrestrictedTraverse
(
relative_url
)
property_value
=
obj
.
getProperty
(
property_id
)
property_value
=
obj
.
getProperty
(
property_id
)
property_type
=
obj
.
getPropertyType
(
property_id
)
property_type
=
obj
.
getPropertyType
(
property_id
)
self
.
setProperty
(
'name'
,
property_id
)
self
.
setProperty
(
'
item_property_
name'
,
property_id
)
self
.
setProperty
(
'type'
,
property_type
)
self
.
setProperty
(
'
item_property_
type'
,
property_type
)
self
.
setProperty
(
'value'
,
property_value
)
self
.
setProperty
(
'
item_property_
value'
,
property_value
)
def
install
(
self
,
context
):
def
install
(
self
,
context
):
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
path
=
self
.
getProperty
(
'item_path'
)
path
=
self
.
getProperty
(
'item_path'
)
relative_url
,
property_id
=
path
.
split
(
'#'
)
relative_url
,
property_id
=
path
.
split
(
'#'
)
obj
=
portal
.
unrestrictedTraverse
(
relative_url
)
obj
=
portal
.
unrestrictedTraverse
(
relative_url
)
property_name
=
self
.
getProperty
(
'name'
)
property_name
=
self
.
getProperty
(
'
item_property_
name'
)
property_type
=
self
.
getProperty
(
'type'
)
property_type
=
self
.
getProperty
(
'
item_property_
type'
)
property_value
=
self
.
getProperty
(
'value'
)
property_value
=
self
.
getProperty
(
'
item_property_
value'
)
# First remove the property from the existing path and keep the default
# First remove the property from the existing path and keep the default
# empty, and update only if the sign is +1
# empty, and update only if the sign is +1
obj
.
_delPropValue
(
property_name
)
obj
.
_delPropValue
(
property_name
)
...
...
product/ERP5/Tool/TemplateTool.py
View file @
d6ffba49
...
@@ -1773,12 +1773,14 @@ class TemplateTool (BaseTool):
...
@@ -1773,12 +1773,14 @@ class TemplateTool (BaseTool):
# Update hashes of item in old state before installation
# Update hashes of item in old state before installation
for
item
in
old_installation_state
.
objectValues
():
for
item
in
old_installation_state
.
objectValues
():
if
item
.
isProperty
:
if
item
.
isProperty
:
value
_list
=
item
.
getProperty
(
'
value'
)
value
=
item
.
getProperty
(
'item_property_
value'
)
else
:
else
:
value_list
=
item
.
objectValues
()
value_list
=
item
.
objectValues
()
if
value_list
:
if
value_list
:
value
=
value_list
[
0
]
if
value
:
item
.
setProperty
(
'item_sha'
,
self
.
calculateComparableHash
(
item
.
setProperty
(
'item_sha'
,
self
.
calculateComparableHash
(
value
_list
[
0
]
,
value
,
item
.
isProperty
,
item
.
isProperty
,
))
))
...
@@ -1788,9 +1790,8 @@ class TemplateTool (BaseTool):
...
@@ -1788,9 +1790,8 @@ class TemplateTool (BaseTool):
# If the path has been removed, then add it with sign = -1
# If the path has been removed, then add it with sign = -1
old_item
=
old_installation_state
.
getBusinessItemByPath
(
item
.
getProperty
(
'item_path'
))
old_item
=
old_installation_state
.
getBusinessItemByPath
(
item
.
getProperty
(
'item_path'
))
# Calculate sha for the items in new_insatallation_state
# Calculate sha for the items in new_insatallation_state
import
pdb
;
pdb
.
set_trace
()
if
item
.
isProperty
:
if
item
.
isProperty
:
value
=
item
.
getProperty
(
'value'
)
value
=
item
.
getProperty
(
'
item_property_
value'
)
else
:
else
:
value
=
item
.
objectValues
()[
0
]
value
=
item
.
objectValues
()[
0
]
item
.
setProperty
(
'item_sha'
,
self
.
calculateComparableHash
(
item
.
setProperty
(
'item_sha'
,
self
.
calculateComparableHash
(
...
@@ -1953,6 +1954,7 @@ class TemplateTool (BaseTool):
...
@@ -1953,6 +1954,7 @@ class TemplateTool (BaseTool):
# XXX: Hack for not trying to install the sub-objects from zexp,
# XXX: Hack for not trying to install the sub-objects from zexp,
# This should rather be implemented while exporting the object,
# This should rather be implemented while exporting the object,
# where we shouldn't export sub-objects in the zexp
# where we shouldn't export sub-objects in the zexp
if
not
isProperty
:
try
:
try
:
value
=
new_item
.
objectValues
()[
0
]
value
=
new_item
.
objectValues
()[
0
]
except
IndexError
:
except
IndexError
:
...
...
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