Commit 37129c23 authored by Jérome Perrin's avatar Jérome Perrin

Remove obsolete APIs

getSimulationQuantity/Source/Destination..
getOrderQuantity/Source/Destination...
getDeliveryQuantity/Source/Destination...

Those methods were not used and were calling some non existing ZSQL Methods
XXX wrong ! getSimulationQuantity is used !
parent e8ef5b33
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string>ZSQLCatalog.zsqlbrain</string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string>ZSQLBrain</string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OrderLine_zGetRelatedQuantity</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
SELECT\n
SUM(movement.quantity) AS quantity\n
FROM\n
category, movement\n
WHERE\n
category.category_uid = <dtml-sqlvar uid type="int">\n
AND\n
category.uid = movement.uid\n
AND\n
category.base_category_uid = <dtml-sqlvar expr="portal_categories.order.getUid()" type="int">\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -108,22 +108,6 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
"""
return self.getParentValue().getRootDeliveryValue()
# Simulation Consistency Check
def getSimulationQuantity(self):
"""
Computes the quantities in the simulation
"""
if isinstance(self, OrderLine):
result = self.OrderLine_zGetRelatedQuantity(uid=self.getUid())
if len(result) > 0:
return result[0].quantity
return None
else:
result = self.DeliveryLine_zGetRelatedQuantity(uid=self.getUid())
if len(result) > 0:
return result[0].quantity
return None
security.declareProtected( Permissions.ModifyPortalContent,
'notifyAfterUpdateRelatedContent' )
def notifyAfterUpdateRelatedContent(self, previous_category_url,
......
......@@ -306,45 +306,6 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, ImmobilisationMovement):
#
# return error_list
# Simulation Consistency Check
def getSimulationQuantity(self):
"""
Computes the quantities in the simulation
"""
if not self.hasCellContent():
result = self.DeliveryLine_zGetRelatedQuantity(uid=self.getUid())
if len(result) > 0:
return result[0].quantity
return None
def getSimulationSourceList(self):
"""
Computes the sources in the simulation
"""
result = self.DeliveryLine_zGetRelatedSource(uid=self.getUid())
return map(lambda x: x.source, result)
def getSimulationDestinationList(self):
"""
Computes the destinations in the simulation
"""
result = self.DeliveryLine_zGetRelatedDestination(uid=self.getUid())
return map(lambda x: x.destination, result)
def getSimulationSourceSectionList(self):
"""
Computes the source sections in the simulation
"""
result = self.DeliveryLine_zGetRelatedSourceSection(uid=self.getUid())
return map(lambda x: x.source_section, result)
def getSimulationDestinationSectionList(self):
"""
Computes the destination sections in the simulation
"""
result = self.DeliveryLine_zGetRelatedDestinationSection(uid=self.getUid())
return map(lambda x: x.destination_section, result)
security.declareProtected(Permissions.AccessContentsInformation,
'getRootDeliveryValue')
def getRootDeliveryValue(self):
......
......@@ -591,182 +591,6 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
return simulation_movement is not None and \
not simulation_movement.getParentValue().isRootAppliedRule()
# New Causality API
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderQuantity')
def getOrderQuantity(self):
"""
Returns the quantity of related order(s)
"""
# XXX deprecated
return self.getQuantity()
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliveryQuantity')
def getDeliveryQuantity(self):
"""
Returns the quantity of related delivery(s)
"""
return self.getQuantity()
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationQuantity')
def getSimulationQuantity(self):
"""
Returns the sum of quantities in related simulation movements
"""
return self.getQuantity()
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderStartDateList')
def getOrderStartDateList(self):
"""
Returns the list of start date of related order(s)
"""
# XXX deprecated
return [self.getStartDate()]
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliveryStartDateList')
def getDeliveryStartDateList(self):
"""
Returns the list of start date of related delivery(s)
"""
return [self.getStartDate()]
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationStartDateList')
def getSimulationStartDateList(self):
"""
Returns the list of start date related simulation movements
"""
return [self.getStartDate()]
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderStopDateList')
def getOrderStopDateList(self):
"""
Returns the list of stop date of related order(s)
"""
# XXX deprecated
return [self.getStopDate()]
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliveryStopDateList')
def getDeliveryStopDateList(self):
"""
Returns the list of stop date of related delivery(s)
"""
return [self.getStopDate()]
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationStopDateList')
def getSimulationStopDateList(self):
"""
Returns the list of stop date related simulation movements
"""
return [self.getStopDate()]
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderSourceList')
def getOrderSourceList(self):
"""
Returns the source of related orders
"""
# XXX deprecated
return self.getSourceList()
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliverySourceList')
def getDeliverySourceList(self):
"""
Returns the source of related deliveries
"""
return self.getSourceList()
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationSourceList')
def getSimulationSourceList(self):
"""
Returns the source of related simulation movements
"""
return self.getSourceList()
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderDestinationList')
def getOrderDestinationList(self):
"""
Returns the destination of related orders
"""
# XXX deprecated
return self.getDestinationList()
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliveryDestinationList')
def getDeliveryDestinationList(self):
"""
Returns the destination of related deliveries
"""
return self.getDestinationList()
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationDestinationList')
def getSimulationDestinationList(self):
"""
Returns the destination of related simulation movements
"""
return self.getDestinationList()
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderSourceSectionList')
def getOrderSourceSectionList(self):
"""
Returns the source_section of related orders
"""
# XXX deprecated
return self.getSourceSectionList()
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliverySourceSectionList')
def getDeliverySourceSectionList(self):
"""
Returns the source_section of related deliveries
"""
return self.getSourceSectionList()
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationSourceSectionList')
def getSimulationSourceSectionList(self):
"""
Returns the source_section of related simulation movements
"""
return self.getSourceSectionList()
security.declareProtected( Permissions.AccessContentsInformation,
'getOrderDestinationSectionList')
def getOrderDestinationSectionList(self):
"""
Returns the destination_section of related orders
"""
# XXX deprecated
return self.getDestinationSectionList()
security.declareProtected( Permissions.AccessContentsInformation,
'getDeliveryDestinationSectionList')
def getDeliveryDestinationSectionList(self):
"""
Returns the destination_section of related deliveries
"""
return self.getDestinationSectionList()
security.declareProtected( Permissions.AccessContentsInformation,
'getSimulationDestinationSectionList')
def getSimulationDestinationSectionList(self):
"""
Returns the destination_section of related simulation movements
"""
return self.getDestinationSectionList()
# Debit and credit methods
security.declareProtected( Permissions.AccessContentsInformation,
'getSourceDebit')
......
......@@ -77,13 +77,3 @@ class OrderLine(DeliveryLine):
# And apply
getattr(my_simulation_movement, method_id)()
# Simulation Consistency Check
def getSimulationQuantity(self):
"""
Computes the target quantities in the simulation
"""
result = self.OrderLine_zGetRelatedQuantity(uid=self.getUid())
if len(result) > 0:
return result[0].quantity
return None
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