diff --git a/product/ERP5/Document/BankAccount.py b/product/ERP5/Document/BankAccount.py index 805bc8428acc83f06bfaf20b928ef0e73b37d180..96badbfa8baed8db74f9b361ffe93a8fe262841f 100755 --- a/product/ERP5/Document/BankAccount.py +++ b/product/ERP5/Document/BankAccount.py @@ -62,6 +62,7 @@ class BankAccount(Folder, Coordinate, MetaNode): , PropertySheet.SimpleItem , PropertySheet.Task , PropertySheet.Resource + , PropertySheet.Reference , PropertySheet.BankAccount ) @@ -69,6 +70,19 @@ class BankAccount(Folder, Coordinate, MetaNode): __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 # code as an example. # It might be a potential hazard to have the system automatically fill in the