[Erp5-report] r23546 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Sep 10 13:09:46 CEST 2008


Author: mame
Date: Wed Sep 10 13:09:40 2008
New Revision: 23546

URL: http://svn.erp5.org?rev=23546&view=rev
Log:
2008-09-10 mame
* Took care of case where there is no currency exchange line defined for a transaction

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationExchangeRate.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationSectionItemList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertDestinationPriceDialog.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertSourcePriceDialog.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml Wed Sep 10 13:09:40 2008
@@ -66,10 +66,15 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>from Products.ERP5.Document.Document import ConversionError\n
+\n
 """\n
 Script to convert the prices used in the transaction to the \n
 currency of the destination section\n
-"""\n
+form_id : Page that action is called from\n
+\n
+\n
+"""\n
+\n
 portal = context.getPortalObject()\n
 #get the precision of the destination\n
 precision =context.getDestinationSectionValue().getPriceCurrencyValue().getQuantityPrecision()\n
@@ -94,7 +99,11 @@
                       line.getDestinationSectionValue().getPriceCurrencyId()],\n
                       start_date=line.getStopDate()))\n
 \n
-\n
+#redirect to previous page without doing the conversion\n
+   if exchange_ratio is None:\n
+     return context.Base_redirect(form_id,\n
+                                  keep_items=dict(\n
+                portal_status_message=context.Base_translateString(\'No exchange ratio was found.\'))) \n
 #update the corresponding price and round it according to the precision of\n
 #the converted currency\n
    line.setDestinationTotalAssetPrice(\n
@@ -162,9 +171,9 @@
                             <string>AssertionError</string>
                             <string>currency</string>
                             <string>exchange_ratio</string>
+                            <string>dict</string>
                             <string>round</string>
                             <string>msg</string>
-                            <string>dict</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml Wed Sep 10 13:09:40 2008
@@ -92,7 +92,12 @@
                           categories=[\'resource/%s\' % line.getResourceRelativeUrl(), \n
                                 \'price_currency/currency_module/%s\' %\n
                       line.getSourceSectionValue().getPriceCurrencyId()],\n
-                      start_date=line.getStopDate()))\n
+                      start_date=line.getStartDate()))\n
+#redirect to previous page without doing the conversion\n
+   if exchange_ratio is None:\n
+     return context.Base_redirect(form_id,\n
+                                  keep_items=dict(\n
+                portal_status_message=context.Base_translateString(\'No exchange ratio was found.\'))) \n
 \n
 \n
 #update the corresponding price and round it according to the precision of\n
@@ -162,9 +167,9 @@
                             <string>AssertionError</string>
                             <string>currency</string>
                             <string>exchange_ratio</string>
+                            <string>dict</string>
                             <string>round</string>
                             <string>msg</string>
-                            <string>dict</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationExchangeRate.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationExchangeRate.xml?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationExchangeRate.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationExchangeRate.xml Wed Sep 10 13:09:40 2008
@@ -65,7 +65,12 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>currency = context.getResourceValue()\n
+            <value> <string>"""\n
+Script used to get the exchange ratio used \n
+in the conversion of the destination price\n
+"""\n
+\n
+currency = context.getResourceValue()\n
 exchange_ratio = currency.getPrice(context=context.asContext(categories=[\'resource/%s\' % context.getResourceRelativeUrl(), \n
                                      \'price_currency/currency_module/%s\' % context.getDestinationSectionValue().getPriceCurrencyId()],\n
                                       start_date=context.getStopDate()))\n

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationSectionItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationSectionItemList.xml?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationSectionItemList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationSectionItemList.xml Wed Sep 10 13:09:40 2008
@@ -77,6 +77,7 @@
 if section_value is not None:\n
   result = section_value.getGroupRelatedValueList(portal_type=\'Organisation\',\n
                                                   checked_permission=\'View\')\n
+\n
   result = [r for r in result\n
             if r.getProperty(\'validation_state\') not in (\'invalidated\', \'deleted\')]\n
 \n

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertDestinationPriceDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertDestinationPriceDialog.xml?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertDestinationPriceDialog.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertDestinationPriceDialog.xml Wed Sep 10 13:09:40 2008
@@ -81,25 +81,25 @@
             <value>
               <dictionary>
                 <item>
-                    <key>                 <string>bottom</string> </key>
+                    <key> <string>bottom</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>center</string> </key>
+                    <key> <string>center</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>hidden</string> </key>
+                    <key> <string>hidden</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>left</string> </key>
+                    <key> <string>left</string> </key>
                     <value>
                       <list>
                         <string>my_destination_currency</string>
@@ -108,7 +108,7 @@
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>right</string> </key>
+                    <key> <string>right</string> </key>
                     <value>
                       <list/>
                     </value>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertSourcePriceDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertSourcePriceDialog.xml?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertSourcePriceDialog.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_viewConvertSourcePriceDialog.xml Wed Sep 10 13:09:40 2008
@@ -81,25 +81,25 @@
             <value>
               <dictionary>
                 <item>
-                    <key>                 <string>bottom</string> </key>
+                    <key> <string>bottom</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>center</string> </key>
+                    <key> <string>center</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>hidden</string> </key>
+                    <key> <string>hidden</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>left</string> </key>
+                    <key> <string>left</string> </key>
                     <value>
                       <list>
                         <string>your_exchange_rate</string>
@@ -108,7 +108,7 @@
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>right</string> </key>
+                    <key> <string>right</string> </key>
                     <value>
                       <list/>
                     </value>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=23546&r1=23545&r2=23546&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Wed Sep 10 13:09:40 2008
@@ -1,1 +1,1 @@
-769
+768




More information about the Erp5-report mailing list