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 @@
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>DeliveryType</string> </value>
<value> <string>DeliveryTypeInformation</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
......
......@@ -31,11 +31,14 @@ from Products.ERP5Type import Permissions
from Products.ERP5Type.ERP5Type import ERP5TypeInformation
from zLOG import LOG
class DeliveryType(ERP5TypeInformation):
class DeliveryTypeInformation(ERP5TypeInformation):
"""
Base type for Delivery Type.
A DeliveryType is a BaseType on which a list of ledgers is set,
which is the list of ledger allowed on the delivery objects.
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 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.declareObjectProtected(Permissions.AccessContentsInformation)
......@@ -46,9 +49,9 @@ class DeliveryType(ERP5TypeInformation):
security.declarePublic('constructInstance')
def constructInstance(self, *args, **kw):
"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():
delivery.setLedger(self.getDefaultLedger())
return delivery
InitializeClass( DeliveryType )
InitializeClass( DeliveryTypeInformation )
......@@ -94,15 +94,13 @@ def initialize( context ):
from Base import Base
import XMLObject
from ERP5Type import ERP5TypeInformation
from Products.ERP5Type.DeliveryType import DeliveryType
import CodingStyle
# Define documents, classes, constructors and tools
object_classes = ()
content_constructors = ()
content_classes = ( Base,
XMLObject.XMLObject,
ERP5TypeInformation,
DeliveryType, )
ERP5TypeInformation, )
portal_tools = ( CacheTool.CacheTool,
MemcachedTool.MemcachedTool,
SessionTool.SessionTool,
......
......@@ -43,7 +43,7 @@ class PortalTypeOfPortalTypeTestCase(ERP5TypeTestCase):
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.
This suite checks that its custom features are correctly implemented.
......@@ -73,7 +73,7 @@ class TestDeliveryType(PortalTypeOfPortalTypeTestCase):
def testDefaultLedgerIsSetOnObjectIfSetOnPortalType(self):
"""
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
"""
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