Commit 718255d5 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

cast to a single value if compared target is a single value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32489 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f1612f6b
......@@ -400,6 +400,8 @@ class Rule(Predicate, XMLObject):
for k, v in prevision.items():
if movement.isPropertyRecorded(k):
movement_value = movement.getRecordedProperty(k)
if isinstance(movement_value, list) and not isinstance(v, list):
movement_value = movement_value[0]
else:
movement_value = movement.getProperty(k)
if k not in ('quantity',) and v != movement_value:
......@@ -528,6 +530,8 @@ class Rule(Predicate, XMLObject):
if k not in ('quantity', 'start_date', 'stop_date'):
if movement.isPropertyRecorded(k):
movement_value = movement.getRecordedProperty(k)
if isinstance(movement_value, list) and not isinstance(v, list):
movement_value = movement_value[0]
else:
movement_value = movement.getProperty(k)
if 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