Commit 5ad8c2fd authored by Łukasz Nowak's avatar Łukasz Nowak

- proved, that it is possible to start divergences from delivering what is to consume

 - added needed steps


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22428 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ef15c5e3
...@@ -47,6 +47,10 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking ...@@ -47,6 +47,10 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
packing_list = sequence.get('packing_list') packing_list = sequence.get('packing_list')
packing_list.portal_workflow.doActionFor(packing_list, transition_name) packing_list.portal_workflow.doActionFor(packing_list, transition_name)
def stepAcceptDecisionSupplyDeliveryPackingList(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('supply_delivery_packing_list')
self.modifyPackingListState('accept_decision_action', sequence=sequence, packing_list=packing_list)
def stepAcceptDecisionProducedDeliveryPackingList(self, sequence=None, sequence_list=None, **kw): def stepAcceptDecisionProducedDeliveryPackingList(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('produced_delivery_packing_list') packing_list = sequence.get('produced_delivery_packing_list')
self.modifyPackingListState('accept_decision_action', sequence=sequence, packing_list=packing_list) self.modifyPackingListState('accept_decision_action', sequence=sequence, packing_list=packing_list)
...@@ -55,6 +59,10 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking ...@@ -55,6 +59,10 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
packing_list = sequence.get('supply_delivery_packing_list') packing_list = sequence.get('supply_delivery_packing_list')
self.modifyPackingListState('adopt_prevision_action', sequence=sequence, packing_list=packing_list) self.modifyPackingListState('adopt_prevision_action', sequence=sequence, packing_list=packing_list)
def stepAdoptPrevisionProducedDeliveryPackingList(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('produced_delivery_packing_list')
self.modifyPackingListState('adopt_prevision_action', sequence=sequence, packing_list=packing_list)
def stepAdoptPrevisionProducedReport(self, sequence=None, sequence_list=None, **kw): def stepAdoptPrevisionProducedReport(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('produced_report') packing_list = sequence.get('produced_report')
self.modifyPackingListState('adopt_prevision_action', sequence=sequence, packing_list=packing_list) self.modifyPackingListState('adopt_prevision_action', sequence=sequence, packing_list=packing_list)
...@@ -151,6 +159,14 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking ...@@ -151,6 +159,14 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
quantity = line.getQuantity() - 1.0 quantity = line.getQuantity() - 1.0
) )
def stepDeceraseSupplyDeliveryPackingListQuantity(self, sequence=None, sequence_list=None, **kw):
packing_list = sequence.get('supply_delivery_packing_list')
for line in packing_list.getMovementList():
line.edit(
quantity = line.getQuantity() - 1.0
)
def stepCheckSourcingDeliverySimulationDecerasedQuantity(self, sequence=None, \ def stepCheckSourcingDeliverySimulationDecerasedQuantity(self, sequence=None, \
sequence_list=None, **kw): sequence_list=None, **kw):
""" """
...@@ -287,6 +303,15 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking ...@@ -287,6 +303,15 @@ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPacking
packing_list.getCausalityState() packing_list.getCausalityState()
) )
def stepCheckSupplyDeliveryPackingListIsCalculating(self, sequence=None, \
sequence_list=None, **kw):
packing_list = sequence.get('supply_delivery_packing_list')
self.assertEquals(
'calculating',
packing_list.getCausalityState()
)
def stepCheckSupplyDeliveryPackingListIsConfirmed(self, sequence=None, \ def stepCheckSupplyDeliveryPackingListIsConfirmed(self, sequence=None, \
sequence_list=None, **kw): sequence_list=None, **kw):
packing_list = sequence.get('supply_delivery_packing_list') packing_list = sequence.get('supply_delivery_packing_list')
...@@ -383,6 +408,7 @@ class TestProductionDelivery(TestProductionPackingReportListMixin): ...@@ -383,6 +408,7 @@ class TestProductionDelivery(TestProductionPackingReportListMixin):
""" """
Test for sourcing type of delivery (Production Report and Production Packing Lists). Test for sourcing type of delivery (Production Report and Production Packing Lists).
""" """
# XXX: Need to split to separate test (Luke)
if not run: return if not run: return
delivery_check_sequence_string = self.SOURCING_ORDER_SEQUENCE + '\ delivery_check_sequence_string = self.SOURCING_ORDER_SEQUENCE + '\
...@@ -622,6 +648,133 @@ class TestProductionDelivery(TestProductionPackingReportListMixin): ...@@ -622,6 +648,133 @@ class TestProductionDelivery(TestProductionPackingReportListMixin):
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
# Check a case, when Consumed Delivery Packing List is diverged
# then accept this decision, next deliver it, then adopt prevision
# on rest of documents and deliver them - do it one by one
sequence_string = delivery_check_sequence_string + '\
DeceraseSupplyDeliveryPackingListQuantity \
\
CheckSupplyDeliveryPackingListIsCalculating \
Tic \
CheckSupplyDeliveryPackingListIsDiverged \
AcceptDecisionSupplyDeliveryPackingList \
Tic \
CheckSupplyDeliveryPackingListIsSolved \
CheckSourcingDeliverySimulationDecerasedQuantity \
\
CheckProducedDeliveryPackingListIsConfirmed \
CheckProducedDeliveryPackingListIsDiverged\
\
CheckProducedReportIsConfirmed \
CheckProducedReportIsSolved \
\
CheckConsumedReportIsConfirmed \
CheckConsumedReportIsDiverged\
\
SetReadySupplyDeliveryPackingList \
StartSupplyDeliveryPackingList \
StopSupplyDeliveryPackingList \
DeliverSupplyDeliveryPackingList \
Tic \
\
CheckSourcingDeliverySimulationDecerasedQuantity \
\
CheckSupplyDeliveryPackingListIsDelivered \
CheckSupplyDeliveryPackingListIsSolved\
\
CheckProducedDeliveryPackingListIsConfirmed \
CheckProducedDeliveryPackingListIsDiverged\
\
CheckProducedReportIsConfirmed \
CheckProducedReportIsSolved\
\
CheckConsumedReportIsConfirmed \
CheckConsumedReportIsDiverged\
\
AdoptPrevisionProducedDeliveryPackingList \
Tic \
CheckProducedDeliveryPackingListIsSolved \
\
CheckProducedReportIsConfirmed \
CheckProducedReportIsDiverged\
\
CheckConsumedReportIsConfirmed \
CheckConsumedReportIsDiverged\
\
SetReadyProducedDeliveryPackingList \
StartProducedDeliveryPackingList \
StopProducedDeliveryPackingList \
DeliverProducedDeliveryPackingList \
Tic \
\
CheckSourcingDeliverySimulationDecerasedQuantity \
\
CheckProducedDeliveryPackingListIsDelivered \
CheckProducedDeliveryPackingListIsSolved\
\
CheckSupplyDeliveryPackingListIsDelivered \
CheckSupplyDeliveryPackingListIsSolved\
\
CheckProducedReportIsConfirmed \
CheckProducedReportIsDiverged\
\
CheckConsumedReportIsConfirmed \
CheckConsumedReportIsDiverged\
\
AdoptPrevisionProducedReport \
Tic \
CheckProducedReportIsSolved \
\
CheckConsumedReportIsConfirmed \
CheckConsumedReportIsDiverged\
\
SetReadyProducedReport \
StartProducedReport \
StopProducedReport \
DeliverProducedReport \
Tic \
\
CheckSourcingDeliverySimulationDecerasedQuantity \
\
CheckProducedDeliveryPackingListIsDelivered \
CheckProducedDeliveryPackingListIsSolved\
\
CheckSupplyDeliveryPackingListIsDelivered \
CheckSupplyDeliveryPackingListIsSolved \
\
CheckProducedReportIsDelivered \
CheckProducedReportIsSolved\
\
CheckConsumedReportIsConfirmed \
CheckConsumedReportIsDiverged\
\
AdoptPrevisionConsumedReport \
Tic \
CheckProducedReportIsSolved \
\
SetReadyConsumedReport \
StartConsumedReport \
StopConsumedReport \
DeliverConsumedReport \
Tic \
\
CheckSourcingDeliverySimulationDecerasedQuantity \
\
CheckProducedDeliveryPackingListIsDelivered \
CheckProducedDeliveryPackingListIsSolved\
\
CheckSupplyDeliveryPackingListIsDelivered \
CheckSupplyDeliveryPackingListIsSolved\
\
CheckProducedReportIsDelivered \
CheckProducedReportIsSolved\
\
CheckConsumedReportIsDelivered \
CheckConsumedReportIsSolved\
\
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_suite(): def test_suite():
......
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