Commit 56173791 authored by Rafael Monnerat's avatar Rafael Monnerat

Make Interaction workflow less intrusive

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21330 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9da5fa8
...@@ -65,12 +65,18 @@ ...@@ -65,12 +65,18 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>order = state_change[\'object\']\n <value> <string encoding="cdata"><![CDATA[
order = state_change[\'object\']\n
\n \n
item_list = order.getAggregateValueList()\n item_list = order.getAggregateValueList()\n
quantity = sum([ i.getQuantity() for i in item_list if i.getQuantity() is not None ])\n quantity = sum([ i.getQuantity() for i in item_list if i.getQuantity() is not None ])\n
order.setQuantity(quantity)\n \n
</string> </value> if quantity > order.getQuantity():\n
order.setQuantity(quantity)\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
......
...@@ -68,12 +68,13 @@ ...@@ -68,12 +68,13 @@
<value> <string>order = state_change[\'object\']\n <value> <string>order = state_change[\'object\']\n
\n \n
resource_list = [ ]\n resource_list = [ ]\n
for item in order.getAggregateValueList():\n if order.getResourceValue() in [\'\', None ]:\n
for item in order.getAggregateValueList():\n
resource = item.Item_getResourceValue()\n resource = item.Item_getResourceValue()\n
if resource not in resource_list or (resource is not None):\n if resource not in resource_list or (resource is not None):\n
resource_list.append(resource)\n resource_list.append(resource)\n
\n \n
if len(resource_list) == 1: \n if len(resource_list) == 1: \n
order.setResourceValue(resource)\n order.setResourceValue(resource)\n
</string> </value> </string> </value>
</item> </item>
...@@ -121,11 +122,11 @@ if len(resource_list) == 1: \n ...@@ -121,11 +122,11 @@ if len(resource_list) == 1: \n
<string>_getitem_</string> <string>_getitem_</string>
<string>order</string> <string>order</string>
<string>resource_list</string> <string>resource_list</string>
<string>_getiter_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>None</string>
<string>_getiter_</string>
<string>item</string> <string>item</string>
<string>resource</string> <string>resource</string>
<string>None</string>
<string>len</string> <string>len</string>
</tuple> </tuple>
</value> </value>
......
44 45
\ 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