Commit 7a637cd7 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add the property sheet Reference, and override getReference.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6065 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 59175bf7
...@@ -62,6 +62,7 @@ class BankAccount(Folder, Coordinate, MetaNode): ...@@ -62,6 +62,7 @@ class BankAccount(Folder, Coordinate, MetaNode):
, PropertySheet.SimpleItem , PropertySheet.SimpleItem
, PropertySheet.Task , PropertySheet.Task
, PropertySheet.Resource , PropertySheet.Resource
, PropertySheet.Reference
, PropertySheet.BankAccount , PropertySheet.BankAccount
) )
...@@ -69,6 +70,19 @@ class BankAccount(Folder, Coordinate, MetaNode): ...@@ -69,6 +70,19 @@ class BankAccount(Folder, Coordinate, MetaNode):
__implements__ = ( Interface.Coordinate ) __implements__ = ( Interface.Coordinate )
security.declareProtected(Permissions.AccessContentsInformation, 'getReference')
def getReference(self, **kw):
"""reference depends on the site configuration.
"""
value = self._baseGetReference(**kw)
if value is None:
# Try to get a skin named PortalType_getReference.
portal_type = self.getPortalType()
method = getattr(self, '%s_getReference' % portal_type.replace(' ', ''), None)
if method is not None:
return method(**kw)
# XXX The following "helper methods" have been commented out, and kept in the # XXX The following "helper methods" have been commented out, and kept in the
# code as an example. # code as an example.
# It might be a potential hazard to have the system automatically fill in the # It might be a potential hazard to have the system automatically fill in the
......
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