Commit e844f335 authored by Kevin Deldycke's avatar Kevin Deldycke

Add a comment about the implication of deleting the XMLMatrix.newCellContent() method


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3182 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 57c22024
...@@ -68,17 +68,24 @@ class TempDeliveryCell(DeliveryCell): ...@@ -68,17 +68,24 @@ class TempDeliveryCell(DeliveryCell):
def activate(self): def activate(self):
return self return self
# XXX FIXME: to be deleted # XXX FIXME: to be deleted
class XMLMatrix(TempXMLMatrix): class XMLMatrix(TempXMLMatrix):
def newCellContent(self, id,**kw): def newCellContent(self, id,**kw):
""" """
This method can be overriden If you delete this method, please check the code of the method
ERP5/Document/InventoryLine.newCellContent() and delete it.
If nothing has changed from the date I wrote this comment, the
behaviour of InventoryLine will be the same without
InventoryLine.newCellContent(), because Inventory line is a subclass
of Delivery which is a subclass of XMLMatrix (Kev).
""" """
new_temp_object = TempDeliveryCell(id) new_temp_object = TempDeliveryCell(id)
self._setObject(id, new_temp_object) self._setObject(id, new_temp_object)
return self.get(id) return self.get(id)
# XXX FIXME: to be deleted # XXX FIXME: to be deleted
class Group(Implicit): class Group(Implicit):
""" """
...@@ -212,6 +219,7 @@ class Group(Implicit): ...@@ -212,6 +219,7 @@ class Group(Implicit):
InitializeClass(Group) InitializeClass(Group)
#allow_class(Group) #allow_class(Group)
class Delivery(XMLObject): class Delivery(XMLObject):
""" """
Each time delivery is modified, it MUST launch a reindexing of Each time delivery is modified, it MUST launch a reindexing of
...@@ -431,7 +439,7 @@ class Delivery(XMLObject): ...@@ -431,7 +439,7 @@ class Delivery(XMLObject):
#LOG('buildInvoiceList edit', 0, repr(( object_to_update, cell_quantity, average_price, ))) #LOG('buildInvoiceList edit', 0, repr(( object_to_update, cell_quantity, average_price, )))
object_to_update.edit(quantity = cell_quantity, object_to_update.edit(quantity = cell_quantity,
price = average_price) price = average_price)
# we now reindex the movements we modified # we now reindex the movements we modified
for movement in reindexable_movement_list : for movement in reindexable_movement_list :
movement.immediateReindexObject() movement.immediateReindexObject()
...@@ -492,7 +500,7 @@ class Delivery(XMLObject): ...@@ -492,7 +500,7 @@ class Delivery(XMLObject):
def getTotalQuantity(self, src__=0, **kw): def getTotalQuantity(self, src__=0, **kw):
""" """
Returns the quantity if no cell or the total quantity if cells Returns the quantity if no cell or the total quantity if cells
""" """
kw['explanation_uid'] = self.getUid() kw['explanation_uid'] = self.getUid()
kw.update(self.portal_catalog.buildSQLQuery(**kw)) kw.update(self.portal_catalog.buildSQLQuery(**kw))
if src__: if src__:
...@@ -523,7 +531,7 @@ class Delivery(XMLObject): ...@@ -523,7 +531,7 @@ class Delivery(XMLObject):
def getDelivery(self): def getDelivery(self):
return self.getRelativeUrl() return self.getRelativeUrl()
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getMovementList') 'getMovementList')
def getMovementList(self, portal_type=None, **kw): def getMovementList(self, portal_type=None, **kw):
""" """
...@@ -895,7 +903,7 @@ class Delivery(XMLObject): ...@@ -895,7 +903,7 @@ class Delivery(XMLObject):
destination_section = self.getDestinationSection() destination_section = self.getDestinationSection()
resource = self.getResource() resource = self.getResource()
start_date = self.getStartDate() start_date = self.getStartDate()
def updateLineOrCell(c): def updateLineOrCell(c):
quantity = 0 quantity = 0
source = c.getSource() source = c.getSource()
...@@ -929,7 +937,7 @@ class Delivery(XMLObject): ...@@ -929,7 +937,7 @@ class Delivery(XMLObject):
# Recalculate delivery ratios for the remaining movements in this line # Recalculate delivery ratios for the remaining movements in this line
c.setQuantity(quantity) c.setQuantity(quantity)
c.updateSimulationDeliveryProperties() c.updateSimulationDeliveryProperties()
# Update the transaction from simulation # Update the transaction from simulation
for l in self.contentValues(filter={'portal_type':self.getPortalDeliveryMovementTypeList()}): for l in self.contentValues(filter={'portal_type':self.getPortalDeliveryMovementTypeList()}):
if l.hasCellContent(): if l.hasCellContent():
...@@ -937,7 +945,7 @@ class Delivery(XMLObject): ...@@ -937,7 +945,7 @@ class Delivery(XMLObject):
updateLineOrCell(c) updateLineOrCell(c)
else: else:
updateLineOrCell(l) updateLineOrCell(l)
# Re-aggregate the disconnected movements # Re-aggregate the disconnected movements
# XXX Dirty ; it should use DeliveryBuilder when it will be available # XXX Dirty ; it should use DeliveryBuilder when it will be available
if len(to_aggregate_movement_list) > 0: if len(to_aggregate_movement_list) > 0:
...@@ -945,9 +953,9 @@ class Delivery(XMLObject): ...@@ -945,9 +953,9 @@ class Delivery(XMLObject):
if applied_rule_type == "default_amortisation_rule": if applied_rule_type == "default_amortisation_rule":
self.portal_simulation.buildDeliveryList( self.portal_simulation.collectMovement(to_aggregate_movement_list, self.portal_simulation.buildDeliveryList( self.portal_simulation.collectMovement(to_aggregate_movement_list,
[ResourceMovementGroup, DateMovementGroup, PathMovementGroup] ) ) [ResourceMovementGroup, DateMovementGroup, PathMovementGroup] ) )
# Touch the Transaction to make an automatic converge # Touch the Transaction to make an automatic converge
self.edit() self.edit()
# XXX FIXME: to be deleted # XXX FIXME: to be deleted
security.declareProtected(Permissions.ModifyPortalContent, 'propagateResourceToSimulation') security.declareProtected(Permissions.ModifyPortalContent, 'propagateResourceToSimulation')
...@@ -1010,9 +1018,9 @@ class Delivery(XMLObject): ...@@ -1010,9 +1018,9 @@ class Delivery(XMLObject):
security.declareProtected(Permissions.ModifyPortalContent, 'propagateArrowToSimulation') security.declareProtected(Permissions.ModifyPortalContent, 'propagateArrowToSimulation')
def propagateArrowToSimulation(self): def propagateArrowToSimulation(self):
""" """
Propagates any changes on arrow to the simulation Propagates any changes on arrow to the simulation
propagateArrowToSimulation has priority (ie. must be executed before) over updateFromSimulation propagateArrowToSimulation has priority (ie. must be executed before) over updateFromSimulation
""" """
#LOG('propagateArrowToSimulation, ',0,'starting') #LOG('propagateArrowToSimulation, ',0,'starting')
for l in self.contentValues(filter={'portal_type':delivery_movement_type_list}): for l in self.contentValues(filter={'portal_type':delivery_movement_type_list}):
......
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