Commit 2138aee5 authored by Julien Muchembled's avatar Julien Muchembled

Remove references to legacy simulation

parent 34aa780b
......@@ -57,8 +57,7 @@ if parent.getPortalType() != \'Applied Rule\':\n
return False\n
\n
parent_rule = parent.getSpecialiseValue()\n
if parent_rule.getPortalType() not in (\'Invoice Transaction Simulation Rule\',\n
\'Invoice Transaction Rule\'):\n
if parent_rule.getPortalType() != \'Invoice Transaction Simulation Rule\':\n
return False\n
\n
receivable_account_type_list = (\'asset/receivable\',)\n
......
......@@ -74,12 +74,6 @@ invoice = context\n
\n
related_packing_list = invoice.getDefaultCausalityValue()\n
\n
# copy trade condition:\n
if not context.getSpecialise() and context.portal_skins.hasObject(\'erp5_simulation_legacy\'):\n
related_order = related_packing_list.getDefaultCausalityValue()\n
if related_order is not None:\n
context.edit(specialise=related_order.getSpecialise())\n
\n
# copy title, if not updating a new delivery\n
if not invoice.hasTitle() and related_packing_list.hasTitle():\n
invoice.setTitle(related_packing_list.getTitle())\n
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoice Transaction Rule\', \'Invoice Transaction Simulation Rule\'\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoice Transaction Simulation Rule\'\n
kw[\'explanation_portal_type\'] = \'Sale Order\', \'Sale Invoice\', \'Sale Packing List\'\n
kw[\'grand_parent_simulation_state\'] = \'started\'\n
\n
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>XXX Deprecated. It must be moved to erp5_simulation_legacy BT. 2 new portal types will replace it: Generated Delivery Builder and Simulated Delivery Builder, which will be in erp5_simulation BT.\n
<value> <string>XXX Deprecated. It must be deleted. 2 new portal types replace it: Generated Delivery Builder and Simulated Delivery Builder\n
\n
Delivery Builder objects allow to gather multiple Simulation Movements into\n
a single Delivery. The initial quantity property of the Delivery Line is\n
......
......@@ -60,7 +60,6 @@ skins_tool = context.portal_skins\n
selection_name_dict = {}\n
\n
ok_to_share_selection_form_list = [\'Resource_viewInventory\', \'Resource_viewMovementHistory\']\n
legacy_skin_folders = [\'erp5_simulation_legacy\']\n
\n
for field_path, field in skins_tool.ZopeFind(\n
skins_tool, obj_metatypes=[\'ProxyField\', \'ListBox\'], search_sub=1):\n
......@@ -85,9 +84,6 @@ for field_path, field in skins_tool.ZopeFind(\n
if selection_name == \'\':\n
continue\n
skin_folder, field_path = field_path.split(\'/\', 1)\n
if skin_folder in legacy_skin_folders:\n
# we don\'t care about selection duplication in legacy fields\n
continue\n
field_path_map = selection_name_dict.setdefault(selection_name, {})\n
field_path_map.setdefault(field_path, []).append(skin_folder)\n
\n
......
......@@ -95,26 +95,6 @@ if not invoice.contentValues(portal_type=\'Payment Condition\'):\n
clipboard = related_order.manage_copyObjects(ids=payment_condition_copy_id_list)\n
invoice.manage_pasteObjects(clipboard)\n
\n
if related_order is not None and context.portal_skins.hasObject(\'erp5_simulation_legacy\'):\n
# copy trade condition:\n
if not context.getSpecialise():\n
context.edit(specialise=related_order.getSpecialise())\n
\n
# copy order\'s trade model lines\n
invoice_trade_model_line_reference_list = [document.getReference() \\\n
for document in context.contentValues(portal_type=\'Trade Model Line\')]\n
order_trade_model_line_copy_id_list = []\n
for order_trade_model_line in related_order.contentValues(\n
portal_type=\'Trade Model Line\'):\n
if order_trade_model_line.getReference() not in \\\n
invoice_trade_model_line_reference_list:\n
order_trade_model_line_copy_id_list.append(order_trade_model_line.getId())\n
\n
if order_trade_model_line_copy_id_list:\n
clipboard = related_order.manage_copyObjects(\n
ids=order_trade_model_line_copy_id_list)\n
context.manage_pasteObjects(clipboard)\n
\n
# copy title, if not updating a new delivery\n
if not invoice.hasTitle() and related_packing_list is not None and \\\n
related_packing_list.hasTitle():\n
......
......@@ -62,7 +62,7 @@ for movement in movement_list:\n
line = None\n
\n
# case of trade model movement\n
if ar.getParentValue().getParentValue().getSpecialiseValue().getPortalType() in (\'Trade Model Rule\', \'Trade Model Simulation Rule\'):\n
if ar.getParentValue().getParentValue().getSpecialiseValue().getPortalType() == \'Trade Model Simulation Rule\':\n
line = ar.getParentValue().getParentValue().getParentValue().getDeliveryValue()\n
\n
# in case of invoice rule (ie. starting from Invoice)\n
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoicing Rule\', \'Invoice Simulation Rule\'\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoice Simulation Rule\'\n
kw[\'explanation_portal_type\'] = \'Purchase Order\', \'Purchase Packing List\', \'Returned Purchase Packing List\'\n
kw[\'grand_parent_simulation_state\'] = \'started\', \'stopped\', \'delivered\'\n
\n
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Trade Model Rule\', \'Trade Model Simulation Rule\'\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Trade Model Simulation Rule\'\n
kw[\'explanation_portal_type\'] = (\'Purchase Order\', \'Purchase Packing List\', \'Returned Purchase Packing List\',\n
\'Purchase Invoice Transaction\', \'Purchase Invoice\')\n
kw[\'grand_parent_simulation_state\'] = \'started\', \'stopped\', \'delivered\', \'confirmed\'\n
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoicing Rule\', \'Invoice Simulation Rule\'\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoice Simulation Rule\'\n
kw[\'explanation_portal_type\'] = \'Sale Order\', \'Sale Packing List\', \'Returned Sale Packing List\'\n
kw[\'grand_parent_simulation_state\'] = \'started\', \'stopped\', \'delivered\'\n
\n
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Trade Model Rule\', \'Trade Model Simulation Rule\'\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Trade Model Simulation Rule\'\n
kw[\'explanation_portal_type\'] = (\'Sale Order\', \'Sale Packing List\', \'Returned Sale Packing List\',\n
\'Sale Invoice Transaction\', \'Sale Invoice\')\n
kw[\'grand_parent_simulation_state\'] = \'started\', \'stopped\', \'delivered\', \'confirmed\'\n
......
......@@ -50,8 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = (\'Invoice Transaction Rule\',\n
\'Invoice Transaction Simulation Rule\')\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoice Transaction Simulation Rule\'\n
kw[\'explanation_portal_type\'] = \'Pay Sheet Transaction\'\n
kw[\'grand_parent_simulation_state\'] = \'confirmed\', \'started\'\n
\n
......
......@@ -50,8 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw[\'parent_specialise_portal_type\'] = (\'Invoicing Rule\',\n
\'Invoice Simulation Rule\')\n
<value> <string>kw[\'parent_specialise_portal_type\'] = \'Invoice Simulation Rule\'\n
kw[\'explanation_portal_type\'] = \'Task\', \'Task Report\'\n
kw[\'grand_parent_simulation_state\'] = \'started\', \'stopped\', \'delivered\'\n
\n
......
......@@ -50,17 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
kw[\'query\'] = ComplexQuery(\n
Query(portal_type=\'Simulation Movement\', explanation_portal_type=\'Task\'),\n
ComplexQuery(\n
Query(parent_specialise_portal_type=[\'Order Rule\', \'Delivery Rule\', \'Delivery Root Simulation Rule\'],\n
simulation_state=\'confirmed\'),\n
Query(parent_specialise_portal_type=\'Delivery Simulation Rule\',\n
grand_parent_simulation_state=\'confirmed\'),\n
operator=\'or\'),\n
operator=\'and\')\n
<value> <string>kw[\'explanation_portal_type\'] = \'Task\'\n
kw[\'parent_specialise_portal_type\'] = \'Delivery Simulation Rule\'\n
kw[\'grand_parent_simulation_state\'] = \'confirmed\'\n
\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
return context.Order_zSelectMovement(src__=src__, **kw)\n
......
......@@ -50,20 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
kw[\'query\'] = ComplexQuery(\n
Query(portal_type=\'Simulation Movement\', explanation_portal_type=\'Internal Order\'),\n
ComplexQuery(\n
Query(parent_specialise_portal_type=[\'Order Rule\', \'Delivery Rule\', \'Delivery Root Simulation Rule\'],\n
simulation_state=\'confirmed\'),\n
Query(parent_specialise_portal_type=\'Delivery Simulation Rule\',\n
grand_parent_simulation_state=\'confirmed\'),\n
operator=\'or\'),\n
operator=\'and\')\n
<value> <string>kw[\'explanation_portal_type\'] = \'Internal Order\'\n
kw[\'parent_specialise_portal_type\'] = \'Delivery Simulation Rule\'\n
kw[\'grand_parent_simulation_state\'] = \'confirmed\'\n
\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
\n
return context.Order_zSelectMovement(src__=src__, **kw)\n
</string> </value>
</item>
......
......@@ -50,20 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
kw[\'query\'] = ComplexQuery(\n
Query(portal_type=\'Simulation Movement\', explanation_portal_type=\'Purchase Order\'),\n
ComplexQuery(\n
Query(parent_specialise_portal_type=[\'Order Rule\', \'Delivery Rule\', \'Delivery Root Simulation Rule\'],\n
simulation_state=\'confirmed\'),\n
Query(parent_specialise_portal_type=\'Delivery Simulation Rule\',\n
grand_parent_simulation_state=\'confirmed\'),\n
operator=\'or\'),\n
operator=\'and\')\n
<value> <string>kw[\'explanation_portal_type\'] = \'Purchase Order\'\n
kw[\'parent_specialise_portal_type\'] = \'Delivery Simulation Rule\'\n
kw[\'grand_parent_simulation_state\'] = \'confirmed\'\n
\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
\n
return context.Order_zSelectMovement(src__=src__, **kw)\n
</string> </value>
</item>
......
......@@ -50,17 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
kw[\'query\'] = ComplexQuery(\n
Query(portal_type=\'Simulation Movement\', explanation_portal_type=\'Sale Order\'),\n
ComplexQuery(\n
Query(parent_specialise_portal_type=[\'Order Rule\', \'Delivery Rule\', \'Delivery Root Simulation Rule\'],\n
simulation_state=\'confirmed\'),\n
Query(parent_specialise_portal_type=\'Delivery Simulation Rule\',\n
grand_parent_simulation_state=\'confirmed\'),\n
operator=\'or\'),\n
operator=\'and\')\n
<value> <string>kw[\'explanation_portal_type\'] = \'Sale Order\'\n
kw[\'parent_specialise_portal_type\'] = \'Delivery Simulation Rule\'\n
kw[\'grand_parent_simulation_state\'] = \'confirmed\'\n
\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
return context.Order_zSelectMovement(src__=src__, **kw)\n
......
......@@ -122,18 +122,3 @@ def updateCareerValidationState(self):
line['validation_state'] = line.pop('state')
career.workflow_history._p_changed = 1
career.reindexObject()
def updateInvoiceTransactionRule(self):
"""Invoice Transaction Rule now uses ID instead of relative urls for cell
coordinates (r20475)
"""
assert self.getPortalType() == 'Invoice Transaction Rule'
movement_index = aq_base(self).index['movement']
for index, coordinate_dict in movement_index.items():
fixed_coordinate_list = []
for coord, index in coordinate_dict.items():
new_coord = coord.split('/')[-1]
coordinate_dict[new_coord] = coordinate_dict.pop(coord)
# ( coordinate_dict is a persistent mapping, so no need to mark the
# object as _p_changed )
......@@ -600,35 +600,6 @@ class IntIndexMovementGroup(RootMovementGroup):
allow_class(IntIndexMovementGroup)
class TransformationAppliedRuleCausalityMovementGroup(RootMovementGroup):
"""
Groups movement that comes from simulation movement that shares the
same Production Applied Rule.
"""
def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw)
explanation_relative_url = self._getExplanationRelativeUrl(movement)
self.explanation = explanation_relative_url
explanation_value = movement.getPortalObject().restrictedTraverse(
explanation_relative_url)
self.setGroupEdit(causality_value=explanation_value)
def _getExplanationRelativeUrl(self, movement):
""" Get the order value for a movement """
transformation_applied_rule = movement.getParentValue()
transformation_rule = transformation_applied_rule.getSpecialiseValue()
if transformation_rule.getPortalType() != 'Transformation Rule':
raise MovementGroupError, 'movement! %s' % movement.getPath()
# XXX Dirty hardcoded
production_movement = transformation_applied_rule.pr
production_packing_list = production_movement.getExplanationValue()
return production_packing_list.getRelativeUrl()
def test(self,movement):
return self._getExplanationRelativeUrl(movement) == self.explanation
allow_class(TransformationAppliedRuleCausalityMovementGroup)
class ParentExplanationMovementGroup(RootMovementGroup): pass
class ParentExplanationCausalityMovementGroup(ParentExplanationMovementGroup):
......
......@@ -168,9 +168,6 @@ class asComposedDocument(object):
object_list)
return sortValueList(object_list, sort_on, sort_order, **kw)
# XXX Legacy simulation allows model lines on deliveries.
# Enabled if erp5_simulation_legacy BT is installed.
_LEGACY_SIMULATION = False
class CompositionMixin:
"""
......@@ -212,12 +209,6 @@ class CompositionMixin:
# we don't use getSpecialiseValueList to avoid acquisition on the parent
model_list = effective_list[effective_index].getValueList('specialise',
portal_type=specialise_type_list or ())
elif _LEGACY_SIMULATION:
parent = self
while isinstance(parent, CompositionMixin):
effective_list.append(parent)
parent = parent.getParentValue()
effective_index += len(effective_list)
effective_index += 1
for model in model_list:
model = _getEffectiveModel(model, start_date, stop_date)
......
......@@ -84,8 +84,6 @@ class TestAccountingRulesMixin:
applied_rule_portal_type = "Applied Rule"
simulation_movement_portal_type = "Simulation Movement"
accounting_rule_cell_portal_type = "Accounting Rule Cell"
invoice_transaction_rule_portal_type \
= "Invoice Transaction Rule"
payment_transaction_portal_type = "Payment Transaction"
payment_transaction_line_definition_list = (
......
......@@ -43,12 +43,8 @@ implements_tuple_list = [
(('Products.ERP5.Document.TradeModelLine','TradeModelLine'), 'IAmountGenerator'),
(('Products.ERP5.Document.TradeModelLine','TradeModelLine'), 'IVariated'),
(('Products.ERP5.Document.TradeModelPath','TradeModelPath'), 'IArrowBase'),
(('Products.ERP5Legacy.Document.TradeModelRule','TradeModelRule'), 'IPredicate'),
(('Products.ERP5Legacy.Document.TradeModelRule','TradeModelRule'), 'IRule'),
(('Products.ERP5.Document.Transformation','Transformation'), 'IAmountGenerator'),
(('Products.ERP5.Document.Transformation','Transformation'), 'IVariated'),
(('Products.ERP5Legacy.Document.TransformationRule','TransformationRule'), 'IPredicate'),
(('Products.ERP5Legacy.Document.TransformationRule','TransformationRule'), 'IRule'),
(('Products.ERP5.Document.TransformedResource','TransformedResource'), 'IVariated'),
#IDocument
(('Products.ERP5.Document.Document', 'Document'), 'IDocument'),
......@@ -88,8 +84,6 @@ for failing_method in [
'test_Products.ERP5.Document.BusinessLink_BusinessLink_implements_ICategoryAccessProvider',
'test_Products.ERP5.Document.TradeModelCell_TradeModelCell_implements_IVariated',
'test_Products.ERP5.Document.TradeModelLine_TradeModelLine_implements_IVariated',
'test_Products.ERP5Legacy.Document.TradeModelRule_TradeModelRule_implements_IRule',
'test_Products.ERP5Legacy.Document.TransformationRule_TransformationRule_implements_IRule',
'test_Products.ERP5.Document.Transformation_Transformation_implements_IVariated',
'test_Products.ERP5.Document.TransformedResource_TransformedResource_implements_IVariated',
]:
......
......@@ -6,7 +6,7 @@ import sys
class _ERP5(ERP5TypeTestSuite):
realtime_output = False
enabled_product_list = ('CMFActivity', 'CMFCategory', 'ERP5', 'ERP5Catalog',
'ERP5eGovSecurity', 'ERP5Form', 'ERP5Legacy',
'ERP5eGovSecurity', 'ERP5Form',
'ERP5OOo', 'ERP5Security', 'ERP5SyncML', 'ERP5Type',
'ERP5VCS', 'ERP5Wizard', 'Formulator', 'ERP5Workflow',
'ERP5Configurator','HBTreeFolder2', 'MailTemplates',
......
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