Commit 16283a91 authored by Yusei Tahara's avatar Yusei Tahara

Prevent making root applied rule which may not be needed.

getSimulationQuantity can return None. Before this fix,
since getSimulationQuantity returns None, an empty line
can trigger to generate root applied rule,


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38926 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dd8fcdb9
...@@ -338,7 +338,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, CompositionMixin): ...@@ -338,7 +338,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, CompositionMixin):
if not m.isSimulated(): if not m.isSimulated():
#LOG('Delivery.isSimulated m.getQuantity',0,m.getQuantity()) #LOG('Delivery.isSimulated m.getQuantity',0,m.getQuantity())
#LOG('Delivery.isSimulated m.getSimulationQuantity',0,m.getSimulationQuantity()) #LOG('Delivery.isSimulated m.getSimulationQuantity',0,m.getSimulationQuantity())
if m.getQuantity() != 0.0 or m.getSimulationQuantity() != 0: if m.getQuantity() != 0.0 or m.getSimulationQuantity() not in (0, None):
return 0 return 0
# else Do we need to create a simulation movement ? XXX probably not # else Do we need to create a simulation movement ? XXX probably not
return 1 return 1
......
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