Commit 7241e3be authored by Jérome Perrin's avatar Jérome Perrin

ERP5: rename DeliveryType -> DeliveryTypeInformation

To be consistent with other type information classes such as
SolverTypeInformation or PDFTypeInformation.

At the same time, describe a bit more
parent 97ac9e62
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>type_class</string> </key> <key> <string>type_class</string> </key>
<value> <string>DeliveryType</string> </value> <value> <string>DeliveryTypeInformation</string> </value>
</item> </item>
<item> <item>
<key> <string>type_interface</string> </key> <key> <string>type_interface</string> </key>
......
...@@ -31,11 +31,14 @@ from Products.ERP5Type import Permissions ...@@ -31,11 +31,14 @@ from Products.ERP5Type import Permissions
from Products.ERP5Type.ERP5Type import ERP5TypeInformation from Products.ERP5Type.ERP5Type import ERP5TypeInformation
from zLOG import LOG from zLOG import LOG
class DeliveryType(ERP5TypeInformation): class DeliveryTypeInformation(ERP5TypeInformation):
""" """
Base type for Delivery Type. Base type for Delivery Type.
A DeliveryType is a BaseType on which a list of ledgers is set, A Delivery Type is a Base Type on which a list of ledgers is set,
which is the list of ledger allowed on the delivery objects. which is the list of ledger allowed on the delivery documents.
When creating new deliveries, the delivery's ledger will be initialized to
the default ledger (the first one) set on the delivery type.
""" """
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
...@@ -46,9 +49,9 @@ class DeliveryType(ERP5TypeInformation): ...@@ -46,9 +49,9 @@ class DeliveryType(ERP5TypeInformation):
security.declarePublic('constructInstance') security.declarePublic('constructInstance')
def constructInstance(self, *args, **kw): def constructInstance(self, *args, **kw):
"Creates a new delivery with a default ledger found on the portal type" "Creates a new delivery with a default ledger found on the portal type"
delivery = super(DeliveryType, self).constructInstance(*args, **kw) delivery = super(DeliveryTypeInformation, self).constructInstance(*args, **kw)
if not delivery.hasLedger(): if not delivery.hasLedger():
delivery.setLedger(self.getDefaultLedger()) delivery.setLedger(self.getDefaultLedger())
return delivery return delivery
InitializeClass( DeliveryType ) InitializeClass( DeliveryTypeInformation )
...@@ -94,15 +94,13 @@ def initialize( context ): ...@@ -94,15 +94,13 @@ def initialize( context ):
from Base import Base from Base import Base
import XMLObject import XMLObject
from ERP5Type import ERP5TypeInformation from ERP5Type import ERP5TypeInformation
from Products.ERP5Type.DeliveryType import DeliveryType
import CodingStyle import CodingStyle
# Define documents, classes, constructors and tools # Define documents, classes, constructors and tools
object_classes = () object_classes = ()
content_constructors = () content_constructors = ()
content_classes = ( Base, content_classes = ( Base,
XMLObject.XMLObject, XMLObject.XMLObject,
ERP5TypeInformation, ERP5TypeInformation, )
DeliveryType, )
portal_tools = ( CacheTool.CacheTool, portal_tools = ( CacheTool.CacheTool,
MemcachedTool.MemcachedTool, MemcachedTool.MemcachedTool,
SessionTool.SessionTool, SessionTool.SessionTool,
......
...@@ -43,7 +43,7 @@ class PortalTypeOfPortalTypeTestCase(ERP5TypeTestCase): ...@@ -43,7 +43,7 @@ class PortalTypeOfPortalTypeTestCase(ERP5TypeTestCase):
portal_type.setProperty(property_name, None) portal_type.setProperty(property_name, None)
class TestDeliveryType(PortalTypeOfPortalTypeTestCase): class TestDeliveryTypeInformation(PortalTypeOfPortalTypeTestCase):
""" """
Delivery Type is a Base Type on which a list of allowed ledgers is defined. Delivery Type is a Base Type on which a list of allowed ledgers is defined.
This suite checks that its custom features are correctly implemented. This suite checks that its custom features are correctly implemented.
...@@ -73,7 +73,7 @@ class TestDeliveryType(PortalTypeOfPortalTypeTestCase): ...@@ -73,7 +73,7 @@ class TestDeliveryType(PortalTypeOfPortalTypeTestCase):
def testDefaultLedgerIsSetOnObjectIfSetOnPortalType(self): def testDefaultLedgerIsSetOnObjectIfSetOnPortalType(self):
""" """
Sets up a list of ledger on the Accounting Transaction portal type, Sets up a list of ledger on the Accounting Transaction portal type,
which is a DeliveryType, and checks that new Accounting Transactions which is a DeliveryTypeInformation, and checks that new Accounting Transactions
have a default ledger set at their creation have a default ledger set at their creation
""" """
portal_type = "Accounting Transaction" portal_type = "Accounting Transaction"
......
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