Commit a29ed0dc authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not raise IndexError if an empty list is saved as a recorded property.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34695 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 10dde161
......@@ -387,7 +387,10 @@ class Rule(Predicate, XMLObject):
if movement.isPropertyRecorded(k):
movement_value = movement.getRecordedProperty(k)
if isinstance(movement_value, list) and not isinstance(v, list):
try:
movement_value = movement_value[0]
except IndexError:
movement_value = None
else:
movement_value = movement.getProperty(k)
if k not in ('quantity',) and v != movement_value:
......
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