Commit 0d626d33 authored by Jérome Perrin's avatar Jérome Perrin

no need to access the delivery movement, checking if a category is set is

likely enough


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44184 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1c42b57c
......@@ -219,7 +219,7 @@ class RuleMixin(Predicate):
Only account movements which are not associated to a delivery;
Whenever delivery is there, delivery has priority
"""
return movement.getDeliveryValue() is None
return not movement.getDelivery()
# Implementation of IDivergenceController # XXX-JPS move to IDivergenceController only mixin for
security.declareProtected( Permissions.AccessContentsInformation,
......@@ -229,10 +229,9 @@ class RuleMixin(Predicate):
Returns true if the Simulation Movement is divergent comparing to
the delivery value
"""
delivery = movement.getDeliveryValue()
if delivery is None:
if not movement.getDelivery():
return False
return len(self.getDivergenceList(movement)) != 0
return bool(self.getDivergenceList(movement))
security.declareProtected(Permissions.View, 'getDivergenceList')
def getDivergenceList(self, movement):
......
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