Commit 286b0387 authored by Yusei Tahara's avatar Yusei Tahara

Add special getQuantityUnitValue and getQuantityUnit to cell classes.

quantity_unit on cell must be acquired from line, not from resource.
parent 8352cf33
...@@ -176,3 +176,15 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -176,3 +176,15 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
def isMovement(self): def isMovement(self):
return 1 return 1
# Override getQuantityUnitXXX to negate same methods defined in
# Amount class. Because cell must acquire quantity unit from line
# not from resource.
security.declareProtected( Permissions.AccessContentsInformation,
'getQuantityUnitValue')
def getQuantityUnitValue(self):
return self.getParentValue().getQuantityUnitValue()
security.declareProtected( Permissions.AccessContentsInformation,
'getQuantityUnit')
def getQuantityUnit(self):
return self.getParentValue().getQuantityUnit()
...@@ -65,3 +65,16 @@ class SupplyCell(Path): ...@@ -65,3 +65,16 @@ class SupplyCell(Path):
"""A cell cannot have cell content itself. """A cell cannot have cell content itself.
""" """
return 0 return 0
# Override getQuantityUnitXXX to negate same methods defined in
# Amount class. Because cell must acquire quantity unit from line
# not from resource.
security.declareProtected( Permissions.AccessContentsInformation,
'getQuantityUnitValue')
def getQuantityUnitValue(self):
return self.getParentValue().getQuantityUnitValue()
security.declareProtected( Permissions.AccessContentsInformation,
'getQuantityUnit')
def getQuantityUnit(self):
return self.getParentValue().getQuantityUnit()
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