Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
2b46b3fb
Commit
2b46b3fb
authored
Mar 31, 2017
by
Ayush Tiwari
Committed by
Ayush Tiwari
Nov 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Only add property values after removing the old value
parent
473670e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+5
-3
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+6
-2
No files found.
product/ERP5/Document/BusinessManager.py
View file @
2b46b3fb
...
...
@@ -798,10 +798,12 @@ class BusinessItem(Implicit, Persistent):
self
.
isProperty
=
True
relative_url
,
property_id
=
self
.
_path
.
split
(
'#'
)
obj
=
portal
.
unrestrictedTraverse
(
relative_url
)
# XXX: Here, we do deal with different cases such as if the object exists
# or not or have the same value or compare states
prop
=
self
.
_value
obj
.
setProperty
(
prop
[
'name'
],
prop
[
'value'
],
prop
[
'type'
])
# First remove the property from the existing path and keep the default
# empty, and update only if the sign is +1
obj
.
_delPropValue
(
prop
[
'name'
])
if
self
.
_sign
==
1
:
obj
.
setProperty
(
prop
[
'name'
],
prop
[
'value'
],
prop
[
'type'
])
else
:
path_list
=
self
.
_path
.
split
(
'/'
)
container_path
=
path_list
[:
-
1
]
...
...
product/ERP5/Tool/TemplateTool.py
View file @
2b46b3fb
...
...
@@ -1845,8 +1845,12 @@ class TemplateTool (BaseTool):
# Compare new item hash with ZODB
if
new_item
.
_sha
==
obj_sha
:
# If same hash, do nothing
continue
if
new_item
.
_sign
==
-
1
:
# If the sign is negative, remove the value from the path
new_item
.
install
(
installation_process
)
else
:
# If same hash, and +1 sign, do nothing
continue
else
:
# Install the new_item
...
...
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