Commit f39f45a2 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Override getTranslatedTitle. This is temporary. This should be replaced with...

Override getTranslatedTitle. This is temporary. This should be replaced with code which uses a message object in getTitle.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6000 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 16248b80
......@@ -36,7 +36,8 @@ from zLOG import LOG
class CashCurrency(Resource):
"""
A Resource
CashCurrency defines a cash model for a certain currency.
Typically, banknotes and coins.
"""
meta_type = 'ERP5Banking Cash Currency'
......@@ -65,8 +66,22 @@ class CashCurrency(Resource):
, PropertySheet.CashCurrency
)
security.declareProtected(Permissions.View,'getTitle')
def getTitle(self,**kw):
security.declareProtected(Permissions.View, 'getTitle')
def getTitle(self, **kw):
"""
The title will depend on the Portal Type and the value, for example :
Piece de 500
"""
title = self.getPortalType()
price = self.getBasePrice()
if price is None:
price = 'Not Defined'
else:
price = '%i' % int(price)
return '%s of %s' % (title, price)
security.declareProtected(Permissions.View, 'getTranslatedTitle')
def getTranslatedTitle(self,**kw):
"""
The title will depend on the Portal Type and the value, for example :
Piece de 500
......
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