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

test movement using interface


git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37541 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f27116c3
...@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo ...@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.CMFActivity.ActiveProcess import ActiveProcess from Products.CMFActivity.ActiveProcess import ActiveProcess
from Products.ERP5.interfaces.movement import IMovement
class SolverProcess(XMLObject, ActiveProcess): class SolverProcess(XMLObject, ActiveProcess):
""" """
...@@ -216,11 +217,12 @@ class SolverProcess(XMLObject, ActiveProcess): ...@@ -216,11 +217,12 @@ class SolverProcess(XMLObject, ActiveProcess):
if not isinstance(delivery_or_movement, (tuple, list)): if not isinstance(delivery_or_movement, (tuple, list)):
delivery_or_movement = [delivery_or_movement] delivery_or_movement = [delivery_or_movement]
movement_list = [] movement_list = []
isMovement = IMovement.providedBy
for x in delivery_or_movement: for x in delivery_or_movement:
if x.isDelivery(): if isMovement(x):
movement_list.extend(x.getMovementList())
else:
movement_list.append(x) movement_list.append(x)
else:
movement_list.extend(x.getMovementList())
# We suppose here that movement_list is a list of # We suppose here that movement_list is a list of
# delivery movements. Let us group decisions in such way # delivery movements. Let us group decisions in such way
......
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