Commit 7cb44fc9 authored by Sebastien Robin's avatar Sebastien Robin

allow to display former currency title


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14411 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c6f63ea9
...@@ -72,12 +72,16 @@ class CashCurrency(Resource): ...@@ -72,12 +72,16 @@ class CashCurrency(Resource):
The title will depend on the Portal Type and the value, for example : The title will depend on the Portal Type and the value, for example :
Piece de 500 Piece de 500
""" """
former = getattr(self, 'former', 0)
title = self.getPortalType() title = self.getPortalType()
price = self.getBasePrice() price = self.getBasePrice()
if price is None: if price is None:
price = 'Not Defined' price = 'Not Defined'
else: else:
price = '%i' % int(price) price = '%i' % int(price)
if former:
return 'Former %s of %s' % (title, price)
else:
return '%s of %s' % (title, price) return '%s of %s' % (title, price)
security.declareProtected(Permissions.View, 'getTranslatedTitle') security.declareProtected(Permissions.View, 'getTranslatedTitle')
...@@ -86,12 +90,16 @@ class CashCurrency(Resource): ...@@ -86,12 +90,16 @@ class CashCurrency(Resource):
The title will depend on the Portal Type and the value, for example : The title will depend on the Portal Type and the value, for example :
Piece de 500 Piece de 500
""" """
former = getattr(self, 'former', 0)
title = self.getTranslatedPortalType() title = self.getTranslatedPortalType()
price = self.getBasePrice() price = self.getBasePrice()
if price is None: if price is None:
price = 'Not Defined' price = 'Not Defined'
else: else:
price = '%i' % int(price) price = '%i' % int(price)
if former:
return self.Base_translateString('Former ${title} of ${value}', mapping = {'title' : str(title), 'value' : str(price)})
else:
return self.Base_translateString('${title} of ${value}', mapping = {'title' : str(title), 'value' : str(price)}) return self.Base_translateString('${title} of ${value}', mapping = {'title' : str(title), 'value' : str(price)})
security.declareProtected(Permissions.ModifyPortalContent, '_setVariationList') security.declareProtected(Permissions.ModifyPortalContent, '_setVariationList')
......
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