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
Hugo Ricateau
erp5
Commits
876cdc0c
Commit
876cdc0c
authored
Jan 18, 2018
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BusinessTemplateV2: Get diff of Business Item objects
parent
b28bf2cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
product/ERP5/Document/BusinessTemplateV2.py
product/ERP5/Document/BusinessTemplateV2.py
+20
-2
No files found.
product/ERP5/Document/BusinessTemplateV2.py
View file @
876cdc0c
...
...
@@ -752,8 +752,26 @@ class BusinessItem(XMLObject):
item
=
self
.
removeProperties
(
item
,
True
)
diff
=
deepdiff
.
DeepDiff
(
item
.
__dict__
,
obj
.
__dict__
)
return
diff
.
json
tree_diff
=
deepdiff
.
DeepDiff
(
item
.
__dict__
,
obj
.
__dict__
,
view
=
'tree'
)
diff_tree_list
=
[]
# Flatten the list of DiffValues
for
subset
in
tree_diff
.
values
():
if
isinstance
(
subset
,
set
):
sublist
=
list
(
subset
)
for
item
in
sublist
:
diff_tree_list
.
append
(
item
)
diff_list
=
[]
for
val
in
diff_tree_list
:
new_val
=
{}
new_val
[
'diff'
]
=
val
.
additional
.
get
(
'diff'
,
None
)
new_val
[
't1'
]
=
val
.
t1
new_val
[
't2'
]
=
val
.
t2
new_val
[
'path'
]
=
val
.
path
()[
6
:
-
2
]
diff_list
.
append
(
new_val
)
return
json
.
dumps
(
diff_list
)
def
updateFollowUpPathList
(
self
):
"""
...
...
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