[Erp5-report] r23277 - in /erp5/trunk/bt5/erp5_accounting: WorkflowTemplateItem/portal_work...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 29 10:45:52 CEST 2008


Author: yusei
Date: Fri Aug 29 10:45:43 2008
New Revision: 23277

URL: http://svn.erp5.org?rev=23277&view=rev
Log:
Replace N_ with translateString.

Modified:
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml?rev=23277&r1=23276&r2=23277&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml Fri Aug 29 10:45:43 2008
@@ -68,18 +68,17 @@
             <value> <string encoding="cdata"><![CDATA[
 
 from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-from Products.ERP5Type.Message import Message\n
+from Products.ERP5Type.Message import translateString\n
 \n
 closing_period = state_change[\'object\']\n
 portal = closing_period.getPortalObject()\n
-N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
 valid_state_list = [\'started\', \'stopped\', \'delivered\']\n
 \n
 start_date = closing_period.getStartDate()\n
 stop_date = closing_period.getStopDate()\n
 \n
 if start_date > stop_date:\n
-  raise ValidationFailed, N_("Start Date is After Stop Date")\n
+  raise ValidationFailed, translateString("Start Date is After Stop Date")\n
 \n
 period_list = closing_period.getParentValue().searchFolder(\n
                               simulation_state=valid_state_list,\n
@@ -90,7 +89,7 @@
   period = period.getObject()\n
   if period.getSimulationState() in valid_state_list:\n
     if start_date <= period.getStopDate():\n
-      raise ValidationFailed, N_(\n
+      raise ValidationFailed, translateString(\n
           "${date} is already in an opened accounting period",\n
           mapping={\'date\': start_date})\n
           \n
@@ -99,7 +98,7 @@
   if last_period.getId() == closing_period.getId():\n
     last_period  = period_list[-2].getObject()\n
   if (start_date - last_period.getStopDate()) > 1:\n
-    raise ValidationFailed, N_(\n
+    raise ValidationFailed, translateString(\n
         "Last opened period ends on ${last_openned_date},"+\n
         " this period starts on ${this_period_start_date}."+\n
         " Accounting Periods must be consecutive.",\n
@@ -153,12 +152,11 @@
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
                             <string>Products.ERP5Type.Message</string>
-                            <string>Message</string>
+                            <string>translateString</string>
                             <string>_getitem_</string>
                             <string>closing_period</string>
                             <string>_getattr_</string>
                             <string>portal</string>
-                            <string>N_</string>
                             <string>valid_state_list</string>
                             <string>start_date</string>
                             <string>stop_date</string>

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml?rev=23277&r1=23276&r2=23277&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml Fri Aug 29 10:45:43 2008
@@ -66,11 +66,10 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-from Products.ERP5Type.Message import Message\n
+from Products.ERP5Type.Message import translateString\n
 \n
 period = state_change[\'object\']\n
 portal = period.getPortalObject()\n
-N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
 \n
 valid_simulation_state_list = [\'cancelled\', \'delivered\', \'deleted\', \'rejected\']\n
 all_state_list = [x[1] for x in\n
@@ -86,7 +85,7 @@
       portal_type=portal.getPortalAccountingMovementTypeList(),)\n
 \n
 if movement_list:\n
-  raise ValidationFailed, N_(\n
+  raise ValidationFailed, translateString(\n
     "All Accounting Transactions for this organisation during the period have"\n
     " to be closed first")\n
 </string> </value>
@@ -135,12 +134,11 @@
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
                             <string>Products.ERP5Type.Message</string>
-                            <string>Message</string>
+                            <string>translateString</string>
                             <string>_getitem_</string>
                             <string>period</string>
                             <string>_getattr_</string>
                             <string>portal</string>
-                            <string>N_</string>
                             <string>valid_simulation_state_list</string>
                             <string>append</string>
                             <string>$append0</string>

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml?rev=23277&r1=23276&r2=23277&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml Fri Aug 29 10:45:43 2008
@@ -73,10 +73,9 @@
 """\n
 \n
 from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-from Products.ERP5Type.Message import Message\n
+from Products.ERP5Type.Message import translateString\n
 \n
 transaction = state_change[\'object\']\n
-N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
 \n
 # XXX manually default start date to stop date\n
 if not transaction.getStartDate() and transaction.getStopDate():\n
@@ -99,12 +98,12 @@
                        portal_type=[\'Organisation\', \'Person\'])\n
 \n
 if source_section is None and destination_section is None:\n
-  raise ValidationFailed(N_(\'At Least One Section Must be Defined\'))\n
+  raise ValidationFailed(translateString(\'At Least One Section Must be Defined\'))\n
 \n
 # check that no categories are used for section\n
 if transaction.getSourceSectionValue(portal_type=\'Category\') is not None or\\\n
     transaction.getDestinationSectionValue(portal_type=\'Category\') is not None:\n
-  raise ValidationFailed(N_(\'Using Category for Section is Invalid\'))\n
+  raise ValidationFailed(translateString(\'Using Category for Section is Invalid\'))\n
 \n
 transaction_line_list = transaction.getMovementList(\n
         portal_type=transaction.getPortalAccountingMovementTypeList())\n
@@ -136,8 +135,8 @@
       if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n
         valid_date = True\n
     if not valid_date:\n
-      raise ValidationFailed(N_("Date is not in an opened Accounting Period "\n
-                                "for source section"))\n
+      raise ValidationFailed(translateString("Date is not in an opened Accounting Period "\n
+                                             "for source section"))\n
   # do the same for destination section \n
   if destination_section is not None:\n
     # if we don\'t have any accounts on this side, we don\'t enforce date checks\n
@@ -160,8 +159,8 @@
       if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n
         valid_date = True\n
     if not valid_date:\n
-      raise ValidationFailed(N_("Date is not in an opened Accounting Period "\n
-                                "for destination section"))\n
+      raise ValidationFailed(translateString("Date is not in an opened Accounting Period "\n
+                                             "for destination section"))\n
 
 
 ]]></string> </value>
@@ -228,10 +227,9 @@
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
                             <string>Products.ERP5Type.Message</string>
-                            <string>Message</string>
+                            <string>translateString</string>
                             <string>_getitem_</string>
                             <string>transaction</string>
-                            <string>N_</string>
                             <string>_getattr_</string>
                             <string>skip_period_validation</string>
                             <string>transition</string>

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.xml?rev=23277&r1=23276&r2=23277&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.xml Fri Aug 29 10:45:43 2008
@@ -71,7 +71,7 @@
 """\n
 \n
 from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-from Products.ERP5Type.Message import Message\n
+from Products.ERP5Type.Message import translateString\n
 \n
 transaction = state_change[\'object\']\n
 portal = transaction.getPortalObject()\n
@@ -99,21 +99,21 @@
     ):\n
 \n
     if account is not None and account.getValidationState() != \'validated\':\n
-      raise ValidationFailed, N_(\n
+      raise ValidationFailed, translateString(\n
           "Account ${account_title} is not opened",\n
            mapping=dict(account_title=unicode(\n
               account.Account_getFormattedTitle(), \'utf8\')))\n
       \n
     if third_party is not None and\\\n
         third_party.getValidationState() in invalid_state_list:\n
-      raise ValidationFailed, N_(\n
+      raise ValidationFailed, translateString(\n
           "Third Party ${third_party_name} is invalid",\n
            mapping=dict(third_party_name=unicode(\n
                       third_party.getTitle(), \'utf8\')))\n
       \n
     if bank_account is not None and\\\n
         bank_account.getValidationState() in invalid_state_list:\n
-      raise ValidationFailed, N_(\n
+      raise ValidationFailed, translateString(\n
           "Bank Account ${bank_account_reference} is invalid",\n
            mapping=dict(bank_account_reference=unicode(\n
                           bank_account.getReference(), \'utf8\')))\n
@@ -124,7 +124,7 @@
         bank_account_currency = bank_account.getProperty(\'price_currency\')\n
         if bank_account_currency is not None and \\\n
               bank_account_currency != line.getResource():\n
-          raise ValidationFailed, N_(\n
+          raise ValidationFailed, translateString(\n
               "Bank Account ${bank_account_reference} "\n
               "uses ${bank_account_currency} as default currency",\n
              mapping=dict(\n
@@ -199,7 +199,7 @@
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
                             <string>Products.ERP5Type.Message</string>
-                            <string>Message</string>
+                            <string>translateString</string>
                             <string>_getitem_</string>
                             <string>transaction</string>
                             <string>_getattr_</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=23277&r1=23276&r2=23277&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Fri Aug 29 10:45:43 2008
@@ -1,1 +1,1 @@
-750
+751




More information about the Erp5-report mailing list