[Erp5-report] r15361 - in /erp5/trunk/bt5/erp5_banking_core: PropertySheetTemplateItem/ Ski...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 27 15:05:01 CEST 2007
Author: seb
Date: Fri Jul 27 15:05:00 2007
New Revision: 15361
URL: http://svn.erp5.org?rev=15361&view=rev
Log:
- added CurrencyExchangeRate propertySheet
- change script ERP5Banking_getExchange in order to take into account specific rates
Added:
erp5/trunk/bt5/erp5_banking_core/PropertySheetTemplateItem/CurrencyExchangeRate.py
Modified:
erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml
erp5/trunk/bt5/erp5_banking_core/bt/revision
erp5/trunk/bt5/erp5_banking_core/bt/template_property_sheet_id_list
Added: erp5/trunk/bt5/erp5_banking_core/PropertySheetTemplateItem/CurrencyExchangeRate.py
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/PropertySheetTemplateItem/CurrencyExchangeRate.py?rev=15361&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/PropertySheetTemplateItem/CurrencyExchangeRate.py (added)
+++ erp5/trunk/bt5/erp5_banking_core/PropertySheetTemplateItem/CurrencyExchangeRate.py Fri Jul 27 15:05:00 2007
@@ -1,0 +1,40 @@
+##############################################################################
+#
+# Copyright (c) 2002-2007 Nexedi SARL and Contributors. All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+class CurrencyExchangeRate:
+ """
+ PropertySheetTemplate properties for all ERP5 objects
+ """
+
+ _properties = (
+ { 'id' : 'currency_exchange_rate',
+ 'description' : 'A particular currency exchange rate used',
+ 'type' : 'float',
+ 'mode' : 'w' },
+ )
+
+
Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml?rev=15361&r1=15360&r2=15361&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ERP5Banking_getExchangeValue.xml Fri Jul 27 15:05:00 2007
@@ -67,13 +67,17 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
-rate_list = context.CurrencyExchange_getExchangeRateList(from_currency=from_currency,\n
+rate = None\n
+method = getattr(context, \'getCurrencyExchangeRate\', None)\n
+if method is not None:\n
+ rate = method()\n
+if rate is None:\n
+ rate_list = context.CurrencyExchange_getExchangeRateList(from_currency=from_currency,\n
to_currency=to_currency, \n
currency_exchange_type=currency_exchange_type,\n
start_date=start_date)\n
-rate = None\n
-if len(rate_list) > 0:\n
- rate = rate_list[0]\n
+ if len(rate_list) > 0:\n
+ rate = rate_list[0]\n
\n
price = context.getSourceTotalAssetPrice()\n
\n
@@ -145,11 +149,13 @@
<string>to_currency</string>
<string>currency_exchange_type</string>
<string>start_date</string>
- <string>_getattr_</string>
- <string>context</string>
- <string>rate_list</string>
<string>None</string>
<string>rate</string>
+ <string>getattr</string>
+ <string>context</string>
+ <string>method</string>
+ <string>_getattr_</string>
+ <string>rate_list</string>
<string>len</string>
<string>_getitem_</string>
<string>price</string>
Modified: erp5/trunk/bt5/erp5_banking_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/bt/revision?rev=15361&r1=15360&r2=15361&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_core/bt/revision Fri Jul 27 15:05:00 2007
@@ -1,1 +1,1 @@
-320
+323
Modified: erp5/trunk/bt5/erp5_banking_core/bt/template_property_sheet_id_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/bt/template_property_sheet_id_list?rev=15361&r1=15360&r2=15361&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/bt/template_property_sheet_id_list (original)
+++ erp5/trunk/bt5/erp5_banking_core/bt/template_property_sheet_id_list Fri Jul 27 15:05:00 2007
@@ -1,3 +1,4 @@
CheckModel
RenderingPreference
-BaobabStopDate
+BaobabStopDate
+CurrencyExchangeRate
More information about the Erp5-report
mailing list