[Erp5-report] r6913 - /erp5/trunk/products/ERP5/Document/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 24 19:05:11 CEST 2006
Author: jerome
Date: Mon Apr 24 19:05:03 2006
New Revision: 6913
URL: http://svn.erp5.org?rev=6913&view=rev
Log:
Remove references to "Piece Tissu" and other dead code
Modified:
erp5/trunk/products/ERP5/Document/DeliveryCell.py
erp5/trunk/products/ERP5/Document/DeliveryLine.py
erp5/trunk/products/ERP5/Document/InventoryCell.py
erp5/trunk/products/ERP5/Document/InventoryLine.py
Modified: erp5/trunk/products/ERP5/Document/DeliveryCell.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/DeliveryCell.py?rev=6913&r1=6912&r2=6913&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/DeliveryCell.py (original)
+++ erp5/trunk/products/ERP5/Document/DeliveryCell.py Mon Apr 24 19:05:03 2006
@@ -184,55 +184,6 @@
# We have acquisition here which me should mimic
return self.getParentValue().getQuantity()
- def _setItemIdList(self, value):
- """
- Computes total_quantity of all given items and stores this total_quantity
- in the quantity attribute of the cell
- """
- previous_item_list = self.getAggregateValueList()
- given_item_id_list = value
- item_object_list = []
- for item in given_item_id_list :
- item_result_list = self.portal_catalog(id = item,
- portal_type="Piece Tissu")
- if len(item_result_list) == 1 :
- try :
- object = item_result_list[0].getObject()
- except AttributeError:
- object = None
- else :
- object = None
-
- if object is not None :
- # if item was in previous_item_list keep it
- if object in previous_item_list :
- # we can add this item to the list of aggregated items
- item_object_list.append(object)
- # if new item verify if variated_resource of item == variated_resource of movement
- elif (self.getResource() == object.getResource()) and (self.getVariationCategoryList() == object.getVariationCategoryList()) :
- # now verify if item can be moved (not already done)
- last_location_title = object.getLastLocationTitle()
- if self.getDestinationTitle() != last_location_title or last_location_title == '' :
- # we can add this item to the list of aggregated items
- item_object_list.append(object)
-
- # update item_id_list and build relation
- self.setAggregateValueList(item_object_list)
-
- # update quantity if needed
- if len(item_object_list)>0 :
- quantity = 0
-
- for object_item in item_object_list :
- if self.aq_parent.aq_parent.getPortalType() in ('Purchase Packing List', ) :
- quantity += object_item.getQuantity()
- else :
- quantity += object_item.getRemainingQuantity()
- # we reset the location of the item
- object_item.setLocation('')
-
- self.setTargetQuantity(quantity)
-
# Required for indexing
security.declareProtected(Permissions.AccessContentsInformation,
'getInventoriatedQuantity')
Modified: erp5/trunk/products/ERP5/Document/DeliveryLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/DeliveryLine.py?rev=6913&r1=6912&r2=6913&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/DeliveryLine.py (original)
+++ erp5/trunk/products/ERP5/Document/DeliveryLine.py Mon Apr 24 19:05:03 2006
@@ -26,18 +26,14 @@
#
##############################################################################
-from Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
-from Acquisition import aq_base
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5Type.XMLMatrix import XMLMatrix
from Products.ERP5Type.XMLObject import XMLObject
-from Products.ERP5Type.Base import Base
from Products.ERP5.Document.Movement import Movement
from Products.ERP5.Variated import Variated
-from Products.CMFCategory.Renderer import Renderer
from Products.ERP5.Document.ImmobilisationMovement import ImmobilisationMovement
from zLOG import LOG
@@ -235,9 +231,7 @@
getattr(my_simulation_movement.getObject(), method_id)()
def reindexObject(self, *k, **kw):
- """
- Reindex children and simulation
- """
+ """Reindex children"""
self.recursiveReindexObject(*k, **kw)
security.declareProtected(Permissions.AccessContentsInformation, 'getInventoriatedQuantity')
@@ -257,57 +251,6 @@
"""
"""
return Movement.getStopDate(self)
-
- def _setItemIdList(self, value):
- """
- Computes total_quantity of all given items and stores this total_quantity
- in the quantity attribute of the cell
- """
- if value is None:
- return
- previous_item_list = self.getAggregateValueList()
- given_item_id_list = value
- item_object_list = []
- for item in given_item_id_list :
- item_result_list = self.portal_catalog(id = item, portal_type="Piece Tissu")
- if len(item_result_list) == 1 :
- try :
- object = item_result_list[0].getObject()
- except AttributeError:
- object = None
- else :
- object = None
-
- if object is not None :
- # if item was in previous_item_list keep it
- if object in previous_item_list :
- # we can add this item to the list of aggregated items
- item_object_list.append(object)
- # if new item verify if variated_resource of item == variated_resource of movement
- elif (self.getResource() == object.getResource()) and (self.getVariationCategoryList() == object.getVariationCategoryList()) :
- # now verify if item can be moved (not already done)
- last_location_title = object.getLastLocationTitle()
- if self.getDestinationTitle() != last_location_title or last_location_title == '' :
- # we can add this item to the list of aggregated items
- item_object_list.append(object)
-
- # update item_id_list and build relation
- self.setAggregateValueList(item_object_list)
-
- # update quantity if needed
- if len(item_object_list)>0 :
- quantity = 0
-
- for object_item in item_object_list :
- if self.aq_parent.getPortalType() in ('Purchase Packing List', ) :
- quantity += object_item.getQuantity()
- else :
- quantity += object_item.getRemainingQuantity()
- # we reset the location of the item
- object_item.setLocation('')
-
- self.setTargetQuantity(quantity)
-
# security.declarePrivate('_checkConsistency')
# def _checkConsistency(self, fixit=0, mapped_value_property_list = ('quantity', 'price')):
Modified: erp5/trunk/products/ERP5/Document/InventoryCell.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/InventoryCell.py?rev=6913&r1=6912&r2=6913&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/InventoryCell.py (original)
+++ erp5/trunk/products/ERP5/Document/InventoryCell.py Mon Apr 24 19:05:03 2006
@@ -108,158 +108,6 @@
else:
return None
-
-# XXX Following methods should be useless now
-# security.declareProtected( Permissions.AccessContentsInformation, 'getInventory' )
-# def getInventory(self):
-# """
-# No acquisition for inventories: either defined or None
-# """
-# if 'inventory' in self.getMappedValuePropertyList([]):
-# return getattr(aq_base(self), 'inventory', None)
-# else:
-# return None # return None
-#
-# def _setItemIdList(self, value):
-# """
-# Computes total_quantity of all given items and stores this total_quantity
-# in the inventory attribute of the cell
-# """
-# if value is None:
-# return
-# previous_item_list = self.getAggregateValueList()
-# given_item_id_list = value
-# item_object_list = []
-# for item in given_item_id_list:
-# item_result_list = self.portal_catalog(id=item, portal_type="Piece Tissu")
-# if len(item_result_list) == 1:
-# try:
-# object = item_result_list[0].getObject()
-# except:
-# object = None
-# else:
-# object = None
-# if object is not None:
-# # if item was in previous_item_list keep it
-# if object in previous_item_list:
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # if new item verify if variated_resource of item == variated_resource of movement
-# elif (self.getResource() == object.getResource()) \
-# and (self.getVariationCategoryList() == object.getVariationCategoryList()):
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # update item_id_list and build relation
-# self.setAggregateValueList(item_object_list)
-# # update inventory if needed
-# if len(item_object_list) > 0:
-# quantity = 0
-# for object_item in item_object_list:
-# quantity += object_item.getRemainingQuantity()
-# self.setInventory(quantity)
-#
-# def _setProducedItemIdList(self, value):
-# """
-# Computes total_quantity of all given items and stores this total_quantity
-# in the quantity attribute of the cell
-# """
-# if value is None:
-# return
-# previous_item_list = self.getAggregateValueList()
-# given_item_id_list = value
-# item_object_list = []
-# for item in given_item_id_list:
-# item_result_list = self.portal_catalog(id=item, portal_type="Piece Tissu")
-# if len(item_result_list) == 1:
-# try:
-# object = item_result_list[0].getObject()
-# except:
-# object = None
-# else:
-# object = None
-# if object is not None:
-# # if item was in previous_item_list keep it
-# if object in previous_item_list:
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # if new item verify if variated_resource of item == variated_resource of movement
-# elif (self.getResource() == object.getResource()) \
-# and (self.getVariationCategoryList() == object.getVariationCategoryList()):
-# # now verify if item can be moved (not already done)
-# last_location_title = object.getLastLocationTitle()
-# if self.getDestinationTitle() != last_location_title or last_location_title == '':
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # update item_id_list and build relation
-# self.setAggregateValueList(item_object_list)
-# # update inventory if needed
-# if len(item_object_list) > 0:
-# quantity = 0
-# for object_item in item_object_list:
-# quantity += object_item.getQuantity()
-# self.setProductionQuantity(quantity)
-#
-# def _setConsumedItemIdList(self, value):
-# """
-# Computes total_quantity of all given items and stores this total_quantity
-# in the quantity attribute of the cell
-# """
-# if value is None:
-# return
-# previous_item_list = self.getAggregateValueList()
-# given_item_id_list = value
-# item_object_list = []
-# for item in given_item_id_list:
-# item_result_list = self.portal_catalog(id=item, portal_type="Piece Tissu")
-# if len(item_result_list) == 1:
-# try :
-# object = item_result_list[0].getObject()
-# except :
-# object = None
-# else :
-# object = None
-# if object is not None:
-# # if item was in previous_item_list keep it
-# if object in previous_item_list:
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # if new item verify if variated_resource of item == variated_resource of movement
-# elif (self.getResource() == object.getResource()) \
-# and (self.getVariationCategoryList() == object.getVariationCategoryList()):
-# # now verify if item can be moved (not already done)
-# last_location_title = object.getLastLocationTitle()
-# if self.getDestinationTitle() == last_location_title or last_location_title == '':
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # update item_id_list and build relation
-# self.setAggregateValueList(item_object_list)
-# # update inventory if needed
-# if len(item_object_list) > 0:
-# quantity = 0
-# for object_item in item_object_list:
-# quantity += object_item.getRemainingQuantity()
-# # we reset the location of the item
-# object_item.setLocation('')
-# self.setConsumptionQuantity(quantity)
-#
-# def getProducedItemIdList(self):
-# """
-# Returns list of items if production_quantity != 0.0
-# """
-# if self.getProductionQuantity() != 0.0:
-# return self.getItemIdList()
-# else:
-# return []
-#
-# def getConsumedItemIdList(self):
-# """
-# Returns list of items if consumption_quantity != 0.0
-# """
-# if self.getConsumptionQuantity() != 0.0:
-# return self.getItemIdList()
-# else:
-# return []
-
# Inventory cataloging
security.declareProtected(Permissions.AccessContentsInformation, 'getConvertedInventory')
def getConvertedInventory(self):
Modified: erp5/trunk/products/ERP5/Document/InventoryLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/InventoryLine.py?rev=6913&r1=6912&r2=6913&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/InventoryLine.py (original)
+++ erp5/trunk/products/ERP5/Document/InventoryLine.py Mon Apr 24 19:05:03 2006
@@ -30,7 +30,6 @@
from Acquisition import aq_base
from Products.ERP5Type import Permissions, PropertySheet, Interface
-from Products.ERP5Type.XMLMatrix import XMLMatrix
from Products.ERP5.Document.DeliveryLine import DeliveryLine
from Products.ERP5.Document.Movement import Movement
@@ -100,7 +99,8 @@
total_quantity += cell.getInventory()
return total_quantity
- security.declareProtected(Permissions.AccessContentsInformation, 'getQuantity')
+ security.declareProtected(Permissions.AccessContentsInformation,
+ 'getQuantity')
def getQuantity(self):
"""
Computes a quantity which allows to reach inventory
@@ -117,149 +117,9 @@
else:
return None
-# XXX Following method should be useless now
-# def _setItemIdList(self, value):
-# """
-# Computes total_quantity of all given items and stores this total_quantity
-# in the inventory attribute of the cell
-# """
-# if value is None:
-# return
-# previous_item_list = self.getAggregateValueList()
-# given_item_id_list = value
-# item_object_list = []
-# for item in given_item_id_list:
-# item_result_list = self.portal_catalog(id=item, portal_type="Piece Tissu")
-# if len(item_result_list) == 1:
-# try:
-# object = item_result_list[0].getObject()
-# except :
-# object = None
-# else:
-# object = None
-# if object is not None:
-# # if item was in previous_item_list keep it
-# if object in previous_item_list:
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # if new item verify if variated_resource of item == variated_resource of movement
-# elif (self.getResource() == object.getResource()) \
-# and (self.getVariationCategoryList() == object.getVariationCategoryList()):
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # update item_id_list and build relation
-# self.setAggregateValueList(item_object_list)
-# # update inventory if needed
-# if len(item_object_list) > 0:
-# quantity = 0
-# for object_item in item_object_list:
-# quantity += object_item.getQuantity()
-# self.setInventory(quantity)
-#
-# def _setProducedItemIdList(self, value):
-# """
-# Computes total_quantity of all given items and stores this total_quantity
-# in the quantity attribute of the cell
-# """
-# if value is None:
-# return
-# previous_item_list = self.getAggregateValueList()
-# given_item_id_list = value
-# item_object_list = []
-# for item in given_item_id_list:
-# item_result_list = self.portal_catalog(id=item, portal_type="Piece Tissu")
-# if len(item_result_list) == 1:
-# try:
-# object = item_result_list[0].getObject()
-# except:
-# object = None
-# else:
-# object = None
-# if object is not None:
-# # if item was in previous_item_list keep it
-# if object in previous_item_list:
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # if new item verify if variated_resource of item == variated_resource of movement
-# elif (self.getResource() == object.getResource()) \
-# and (self.getVariationCategoryList() == object.getVariationCategoryList()):
-# # now verify if item can be moved (not already done)
-# last_location_title = object.getLastLocationTitle()
-# if self.getDestinationTitle() != last_location_title or last_location_title == '':
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # update item_id_list and build relation
-# self.setAggregateValueList(item_object_list)
-# # update inventory if needed
-# if len(item_object_list) > 0:
-# quantity = 0
-# for object_item in item_object_list:
-# quantity += object_item.getQuantity()
-# self.setProductionQuantity(quantity)
-#
-# def _setConsumedItemIdList(self, value):
-# """
-# Computes total_quantity of all given items and stores this total_quantity
-# in the quantity attribute of the cell
-# """
-# if value is None:
-# return
-# previous_item_list = self.getAggregateValueList()
-# given_item_id_list = value
-# item_object_list = []
-# for item in given_item_id_list:
-# item_result_list = self.portal_catalog(id=item, portal_type="Piece Tissu")
-# if len(item_result_list) == 1:
-# try:
-# object = item_result_list[0].getObject()
-# except:
-# object = None
-# else:
-# object = None
-# if object is not None:
-# # if item was in previous_item_list keep it
-# if object in previous_item_list:
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # if new item verify if variated_resource of item == variated_resource of movement
-# elif (self.getResource() == object.getResource()) \
-# and (self.getVariationCategoryList() == object.getVariationCategoryList()):
-# # now verify if item can be moved (not already done)
-# last_location_title = object.getLastLocationTitle()
-# if self.getDestinationTitle() == last_location_title or last_location_title == '':
-# # we can add this item to the list of aggregated items
-# item_object_list.append(object)
-# # update item_id_list and build relation
-# self.setAggregateValueList(item_object_list)
-# # update inventory if needed
-# if len(item_object_list) > 0:
-# quantity = 0
-# for object_item in item_object_list:
-# quantity += object_item.getRemainingQuantity()
-# # we reset the location of the item
-# object_item.setLocation('')
-# self.setConsumptionQuantity(quantity)
-#
-# def getProducedItemIdList(self):
-# """
-# Returns list of items if production_quantity != 0.0
-# """
-# if self.getProductionQuantity() != 0.0:
-# return self.getItemIdList()
-# else:
-# return []
-#
-# def getConsumedItemIdList(self):
-# """
-# Returns list of items if consumption_quantity != 0.0
-# """
-# if self.getConsumptionQuantity() != 0.0:
-# return self.getItemIdList()
-# else:
-# return []
-
# Inventory cataloging
- security.declareProtected(Permissions.AccessContentsInformation, 'getConvertedInventory')
+ security.declareProtected(Permissions.AccessContentsInformation,
+ 'getConvertedInventory')
def getConvertedInventory(self):
"""
provides a default inventory value - None since
@@ -268,7 +128,8 @@
return self.getInventory() # XXX quantity unit is missing
# Required for indexing
- security.declareProtected(Permissions.AccessContentsInformation, 'getInventoriatedQuantity')
+ security.declareProtected(Permissions.AccessContentsInformation,
+ 'getInventoriatedQuantity')
def getInventoriatedQuantity(self):
"""
Take into account efficiency in converted target quantity
More information about the Erp5-report
mailing list