Commit b58797ff authored by Nicolas Delaby's avatar Nicolas Delaby

clear order/delivery on related simulation movements only when its value is the deleted movement.

Thanks to Kazuhiko

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20198 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5c2ba5d8
...@@ -66,8 +66,10 @@ ...@@ -66,8 +66,10 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>line = state_change[\'object\']\n <value> <string>line = state_change[\'object\']\n
# Clean simulation\n
for simulation_movement in line.getDeliveryRelatedValueList():\n for simulation_movement in line.getDeliveryRelatedValueList():\n
simulation_movement.edit(delivery=\'\')\n if simulation_movement.getDelivery() == line.getRelativeUrl():\n
simulation_movement.setDelivery(None)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -128,6 +130,7 @@ for simulation_movement in line.getDeliveryRelatedValueList():\n ...@@ -128,6 +130,7 @@ for simulation_movement in line.getDeliveryRelatedValueList():\n
<string>_getiter_</string> <string>_getiter_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>simulation_movement</string> <string>simulation_movement</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -66,9 +66,11 @@ ...@@ -66,9 +66,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>delivery = state_change[\'object\']\n <value> <string>delivery = state_change[\'object\']\n
# Clean simulation\n
for line in delivery.getMovementList():\n for line in delivery.getMovementList():\n
for simulation_movement in line.getDeliveryRelatedValueList():\n for simulation_movement in line.getDeliveryRelatedValueList():\n
simulation_movement.edit(delivery=\'\')\n if simulation_movement.getDelivery() == line.getRelativeUrl():\n
simulation_movement.setDelivery(None)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -130,6 +132,7 @@ for line in delivery.getMovementList():\n ...@@ -130,6 +132,7 @@ for line in delivery.getMovementList():\n
<string>_getattr_</string> <string>_getattr_</string>
<string>line</string> <string>line</string>
<string>simulation_movement</string> <string>simulation_movement</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
145 146
\ No newline at end of file \ No newline at end of file
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