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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
649a5769
Commit
649a5769
authored
Dec 17, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix update of not yet indexed root simulation movements
parent
37cc2b2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
product/ERP5/mixin/movement_collection_updater.py
product/ERP5/mixin/movement_collection_updater.py
+14
-4
product/ERP5/tests/testRule.py
product/ERP5/tests/testRule.py
+4
-4
No files found.
product/ERP5/mixin/movement_collection_updater.py
View file @
649a5769
...
@@ -169,17 +169,27 @@ class MovementCollectionUpdaterMixin:
...
@@ -169,17 +169,27 @@ class MovementCollectionUpdaterMixin:
movement
.
edit
(
**
kw
)
movement
.
edit
(
**
kw
)
for
property_id
in
kw
:
for
property_id
in
kw
:
movement
.
clearRecordedProperty
(
property_id
)
movement
.
clearRecordedProperty
(
property_id
)
for
movement
in
movement_diff
.
getNewMovementList
():
movement_list
=
movement_diff
.
getNewMovementList
()
if
not
movement_list
:
return
if
context
.
isRootAppliedRule
():
reindex_kw
=
{
'activate_kw'
:
{
'tag'
:
'built:'
+
context
.
getCausalityValue
().
getPath
()}}
else
:
reindex_kw
=
None
def
newMovement
(
kw
=
{}):
return
context
.
newContent
(
portal_type
=
self
.
movement_type
,
reindex_kw
=
reindex_kw
,
**
kw
)
for
movement
in
movement_list
:
d
=
movement
.
__dict__
d
=
movement
.
__dict__
assert
movement
.
isTempObject
()
assert
movement
.
isTempObject
()
if
'_original'
in
d
:
if
'_original'
in
d
:
# slow but safe way (required for compensated movements)
# slow but safe way (required for compensated movements)
context
.
newContent
(
portal_type
=
self
.
movement_type
,
newMovement
(
_getPropertyAndCategoryList
(
movement
))
**
_getPropertyAndCategoryList
(
movement
))
continue
continue
# fast way (we had to make sure such optimization
# fast way (we had to make sure such optimization
# does not touch existing persistent data)
# does not touch existing persistent data)
del
movement
.
__dict__
del
movement
.
__dict__
movement
=
context
.
newContent
(
portal_type
=
self
.
movement_type
)
movement
=
newMovement
(
)
d
.
update
(
movement
.
__dict__
)
d
.
update
(
movement
.
__dict__
)
movement
.
__dict__
=
d
movement
.
__dict__
=
d
product/ERP5/tests/testRule.py
View file @
649a5769
...
@@ -715,10 +715,10 @@ return context.generatePredicate(
...
@@ -715,10 +715,10 @@ return context.generatePredicate(
"""Check that simulation is indexed before being updated
"""Check that simulation is indexed before being updated
It is important that an update of a simulation tree is able to find all
It is important that an update of a simulation tree is able to find all
related simulation movements, otherwise the following happen
d
s:
related simulation movements, otherwise the following happens:
node 1 node
2
2
node 1 node 2
start first indexing of SM ...
start first indexing of SM ...
change simulation state of
PL
change simulation state of PL
update simulation (no SM found)
update simulation (no SM found)
commit result of indexing
commit result of indexing
-> SM has wrong simulation state
-> SM has wrong simulation state
...
@@ -733,7 +733,7 @@ return context.generatePredicate(
...
@@ -733,7 +733,7 @@ return context.generatePredicate(
r
,
=
self
.
portal
.
cmf_activity_sql_connection
.
manage_test
(
r
,
=
self
.
portal
.
cmf_activity_sql_connection
.
manage_test
(
'select * from message_queue'
)
'select * from message_queue'
)
self
.
assertEqual
(
r
.
method_id
,
'_updateSimulation'
)
self
.
assertEqual
(
r
.
method_id
,
'_updateSimulation'
)
expectedFailure
(
self
.
assertEqual
)
(
r
.
processing_node
,
-
1
)
self
.
assertEqual
(
r
.
processing_node
,
-
1
)
def
test_suite
():
def
test_suite
():
...
...
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