Commit 7511be13 authored by Julien Muchembled's avatar Julien Muchembled

Many fixes in testPackingList

- merge patches from testERP5Simulation
- resurrect some solvers that were deleted by mistake
- configure PPL builder like SPL builder for specialise

Also remove expected broken test in testLegacyTradeModelLine

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38111 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 277adf8b
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="SolverTypeInformation" module="Products.ERP5Type.Document.SolverTypeInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The FIFO solver reduces delivered quantity by reducing the quantity of simulation movements from the last order.</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addFIFODeliverySolver</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>delivery_solver</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>FIFO Delivery Solver</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Solver Type</string> </value>
</item>
<item>
<key> <string>solver_action_title</string> </key>
<value> <string>First In, First Out</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_content</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_content</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="SolverTypeInformation" module="Products.ERP5Type.Document.SolverTypeInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The LIFO solver reduces delivered quantity by reducing the quantity of simulation movements from the last order.</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addLIFODeliverySolver</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>delivery_solver</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>LIFO Delivery Solver</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Solver Type</string> </value>
</item>
<item>
<key> <string>solver_action_title</string> </key>
<value> <string>Last In, First Out</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_content</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_content</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="SolverTypeInformation" module="Products.ERP5Type.Document.SolverTypeInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The Minimise Price solver reduces delivered quantity by reducing the quantity of simulation movements from the last order.</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addMinimisePriceDeliverySolver</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>delivery_solver</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Minimise Price Delivery Solver</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Solver Type</string> </value>
</item>
<item>
<key> <string>solver_action_title</string> </key>
<value> <string>Minimise Price</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_content</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_content</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -23,6 +23,12 @@ portal_solvers/Accept Solver
portal_solvers/Accept Solver/*
portal_solvers/Adopt Solver
portal_solvers/Adopt Solver/*
portal_solvers/FIFO Delivery Solver
portal_solvers/FIFO Delivery Solver/*
portal_solvers/LIFO Delivery Solver
portal_solvers/LIFO Delivery Solver/*
portal_solvers/Minimise Price Delivery Solver
portal_solvers/Minimise Price Delivery Solver/*
portal_solvers/Production Reduction Solver
portal_solvers/Production Reduction Solver/*
portal_solvers/Quantity Cancel Solver
......
......@@ -47,6 +47,7 @@
<string>destination_account</string>
<string>source_function</string>
<string>destination_function</string>
<string>specialise</string>
</tuple>
</value>
</item>
......
This diff is collapsed.
......@@ -964,11 +964,11 @@ class TestInvoiceMixin(TestPackingListMixin,
sequence_list=None):
invoice = sequence.get('invoice')
self._solveDeliveryGroupDivergence(invoice, 'start_date',
invoice.getRelativeUrl())
'Unify Solver', value=invoice.getStartDate())
def stepAcceptDecisionQuantityInvoice(self,sequence=None, sequence_list=None):
invoice = sequence.get('invoice')
self._solveDivergence(invoice, 'quantity', 'accept')
self._solveDivergence(invoice, 'quantity', 'Accept Solver')
def stepAcceptDecisionInvoice(self, sequence=None, sequence_list=None,
**kw):
......@@ -2313,11 +2313,8 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
def _acceptDivergenceOnInvoice(self, invoice, divergence_list):
builder_list = invoice.getBuilderList()
self.assertEquals(2, len(builder_list))
for builder in builder_list:
builder.solveDivergence(invoice.getRelativeUrl(),
divergence_to_accept_list=divergence_list)
print invoice, divergence_list
self._solveDivergence(invoice, 'quantity', 'Accept Solver')
def test_accept_quantity_divergence_on_invoice_with_stopped_packing_list(
self, quiet=quiet):
......@@ -2373,11 +2370,8 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
self.assertEquals('solved', packing_list.getCausalityState())
def _adoptDivergenceOnInvoice(self, invoice, divergence_list):
builder_list = invoice.getBuilderList()
self.assertEquals(2, len(builder_list))
for builder in builder_list:
builder.solveDivergence(invoice.getRelativeUrl(),
divergence_to_adopt_list=divergence_list)
print invoice, divergence_list
self._solveDivergence(invoice, 'quantity', 'Adopt Solver')
def test_adopt_quantity_divergence_on_invoice_line_with_stopped_packing_list(
self, quiet=quiet):
......
This diff is collapsed.
......@@ -576,7 +576,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
transaction.commit()
self.tic()
def test_01b_InvoiceModifyQuantityAndSolveDivergency(self):
def test_01b_NewSimulation_InvoiceModifyQuantityAndSolveDivergency(self):
invoice = self.test_01_OrderWithSimpleTaxedAndDiscountedLines('invoice')
for line in invoice.getMovementList():
......
......@@ -38,6 +38,10 @@ from Products.ERP5.tests.testTradeModelLine import *
TestTradeModelLine.trade_model_path_portal_type = None
TestTradeModelLine.business_link_portal_type = None
for name in list(TestTradeModelLine.__dict__):
if '_NewSimulation_' in name:
delattr(TestTradeModelLine, name)
def createBusinessProcess(self, *args, **kw):
business_process = super(TestTradeModelLine, self) \
.createBusinessProcess(*args, **kw)
......
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