From f39f45a29fc8cbe45832c0142d8ffd9270bc9128 Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Mon, 6 Mar 2006 12:30:41 +0000 Subject: [PATCH] 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 --- product/ERP5Banking/Document/CashCurrency.py | 21 +++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/product/ERP5Banking/Document/CashCurrency.py b/product/ERP5Banking/Document/CashCurrency.py index 022e042a76..8389e4cabc 100755 --- a/product/ERP5Banking/Document/CashCurrency.py +++ b/product/ERP5Banking/Document/CashCurrency.py @@ -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 -- 2.30.9