Commit 3310292d authored by Jérome Perrin's avatar Jérome Perrin

Supply Line and Supply Cell are not movements, they are paths.

Also clean up a few imports in the process


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31762 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 897d6b74
...@@ -26,21 +26,13 @@ ...@@ -26,21 +26,13 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.DeliveryCell import DeliveryCell
from Products.ERP5.Document.Path import Path from Products.ERP5.Document.Path import Path
from Products.ERP5.Document.Predicate import Predicate
class SupplyCell(Predicate, DeliveryCell, Path):
"""
A DeliveryCell allows to define specific quantities
for each variation of a resource in a delivery line.
(PATH) class SupplyCell(Path):
"""A Supply Cell is used for different variations in a supply line.
""" """
meta_type = 'ERP5 Supply Cell' meta_type = 'ERP5 Supply Cell'
...@@ -67,3 +59,9 @@ class SupplyCell(Predicate, DeliveryCell, Path): ...@@ -67,3 +59,9 @@ class SupplyCell(Predicate, DeliveryCell, Path):
, PropertySheet.Reference , PropertySheet.Reference
) )
security.declareProtected( Permissions.AccessContentsInformation,
'hasCellContent' )
def hasCellContent(self, base_id='movement'):
"""A cell cannot have cell content itself.
"""
return 0
...@@ -28,16 +28,14 @@ ...@@ -28,16 +28,14 @@
############################################################################## ##############################################################################
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.XMLMatrix import XMLMatrix from Products.ERP5Type.XMLMatrix import XMLMatrix
from Products.ERP5.Document.DeliveryLine import DeliveryLine
from Products.ERP5.Document.Path import Path from Products.ERP5.Document.Path import Path
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from zLOG import LOG
class SupplyLine(DeliveryLine, Path): class SupplyLine(Path, XMLMatrix):
"""A Supply Line is a path to define price """A Supply Line is a path to define price
""" """
...@@ -73,7 +71,6 @@ class SupplyLine(DeliveryLine, Path): ...@@ -73,7 +71,6 @@ class SupplyLine(DeliveryLine, Path):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPrice') 'getPrice')
def getPrice(self): def getPrice(self):
# If price not defined, look up price
if getattr(self, 'price', None) is None: if getattr(self, 'price', None) is None:
self.price = 0.0 self.price = 0.0
# Return the price # Return the price
......
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