[Erp5-report] r34210 jm - in /erp5/trunk: bt5/erp5_trade/WorkflowTemplateItem/portal_workfl...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 30 16:01:49 CEST 2010


Author: jm
Date: Tue Mar 30 16:01:43 2010
New Revision: 34210

URL: http://svn.erp5.org?rev=34210&view=rev
Log:
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).

Modified:
    erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/container_interaction_workflow/scripts/DeliveryMovement_calculatePacking.xml
    erp5/trunk/bt5/erp5_trade/bt/revision
    erp5/trunk/products/ERP5/Document/Container.py

Modified: erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/container_interaction_workflow/scripts/DeliveryMovement_calculatePacking.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/container_interaction_workflow/scripts/DeliveryMovement_calculatePacking.xml?rev=34210&r1=34209&r2=34210&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/container_interaction_workflow/scripts/DeliveryMovement_calculatePacking.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/container_interaction_workflow/scripts/DeliveryMovement_calculatePacking.xml [utf8] Tue Mar 30 16:01:43 2010
@@ -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 @@
                         <value>
                           <tuple>
                             <string>state_change</string>
+                            <string>_getitem_</string>
+                            <string>object</string>
                             <string>_getattr_</string>
-                            <string>_getitem_</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>

Modified: erp5/trunk/bt5/erp5_trade/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/bt/revision?rev=34210&r1=34209&r2=34210&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision [utf8] Tue Mar 30 16:01:43 2010
@@ -1,1 +1,1 @@
-888
+889

Modified: erp5/trunk/products/ERP5/Document/Container.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Container.py?rev=34210&r1=34209&r2=34210&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Container.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Container.py [utf8] Tue Mar 30 16:01:43 2010
@@ -73,6 +73,14 @@
                       , PropertySheet.Container
                       , 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')




More information about the Erp5-report mailing list