Commit a33d9073 authored by Julien Muchembled's avatar Julien Muchembled

Fix activity dependency to update container_state

2 tests in testTradeModelLine were broken since [34190] because
container_interaction_workflow relied on the fact that
causality_interaction_workflow reindexed the delivery.
PackingList.isPacked only requires that container lines/cells are indexed so
the calculatePacking activity now depends on recursive reindexation of the
container (instead of the delivery).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34210 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 363685a2
......@@ -53,10 +53,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>delivery = state_change[\'object\'].getExplanationValue()\n
<value> <string>object = state_change[\'object\']\n
delivery = object.getExplanationValue()\n
\n
if getattr(delivery, \'calculatePacking\', None) is not None:\n
path_and_method_id = (delivery.getPath(), (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
try:\n
container = object.getContainerValue()\n
path_and_method_id = container.getPath(), \'recursiveImmediateReindexObject\'\n
except AttributeError:\n
path_and_method_id = None\n
delivery.activate(after_path_and_method_id=path_and_method_id).calculatePacking()\n
</string> </value>
</item>
......@@ -95,12 +100,15 @@ if getattr(delivery, \'calculatePacking\', None) is not None:\n
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>object</string>
<string>_getattr_</string>
<string>delivery</string>
<string>getattr</string>
<string>None</string>
<string>container</string>
<string>path_and_method_id</string>
<string>AttributeError</string>
</tuple>
</value>
</item>
......
888
\ No newline at end of file
889
\ No newline at end of file
......@@ -74,6 +74,14 @@ class Container(Movement, XMLObject):
, PropertySheet.SortIndex
)
def reindexObject(self, *args, **kw):
"""Reindex container and children
Children must be reindexed because PackingList.isPacked use the catalog
to find them.
"""
self.recursiveReindexObject(*args, **kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getQuantity')
def getQuantity(self, default=1.0):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment