[Erp5-report] r24555 - in /erp5/trunk/bt5/erp5_banking_cash: WorkflowTemplateItem/portal_wo...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 12 11:54:39 CET 2008


Author: aurel
Date: Wed Nov 12 11:54:31 2008
New Revision: 24555

URL: http://svn.erp5.org?rev=24555&view=rev
Log:
if we do a destruction in an auxiliairy agency, we must defined the main agency for which we are working for

Modified:
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml
    erp5/trunk/bt5/erp5_banking_cash/bt/revision

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml?rev=24555&r1=24554&r2=24555&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_destruction_workflow/scripts/validateVaultBalance.xml [utf8] Wed Nov 12 11:54:31 2008
@@ -71,16 +71,16 @@
 from Products.ERP5Type.Message import Message\n
 \n
 transaction = state_change[\'object\']\n
-transaction.log("transaction", "validateVaultBalance")\n
-vault = transaction.getSource()\n
-\n
-source_object = context.portal_categories.getCategoryValue(vault)\n
+\n
+source_object = transaction.getSourceValue()\n
+vault = source_object.getPhysicalPath()\n
 \n
 # check again that we are in the good accounting date\n
 if check_source_counter_date:\n
   transaction.Baobab_checkCounterDateOpen(site=source_object, date=transaction.getStartDate())\n
 \n
-if (\'encaisse_des_externes\' not in vault and \'encaisse_des_billets_retires_de_la_circulation\'  not in vault):\n
+if \'encaisse_des_externes\' not in vault and \\\n
+      \'encaisse_des_billets_retires_de_la_circulation\'  not in vault:\n
    msg = Message(domain="ui", message="Invalid source.")\n
    raise ValidationFailed, (msg,)\n
 \n
@@ -90,25 +90,28 @@
      msg = Message(domain="ui", message="Invalid Foreign Agency.")\n
      raise ValidationFailed, (msg,)\n
 \n
-\n
+if "auxiliaire" in vault and transaction.getSourceSection() in (None, ""):\n
+   msg = Message(domain="ui", message="You must select a foreign agency.")\n
+   raise ValidationFailed, (msg,)\n
 \n
 \n
 # In case of dematerialization, we must have only coins\n
-transaction.log("isDematerialization", transaction.isDematerialization())\n
 if transaction.isDematerialization():\n
   for line in transaction.objectValues(portal_type=\'Monetary Destruction Line\'):\n
-    transaction.log("line", line.getResourceValue().getPortalType())\n
     if line.getResourceValue().getPortalType() != \'Coin\':\n
       msg = Message(domain="ui", message="Sorry, dematerialization is possible only with coins.")\n
       raise ValidationFailed, (msg,)\n
+\n
   # Also we must make sure that the source_section is defined\n
   source_section = transaction.getSourceSection()\n
   if source_section is None:\n
     msg = Message(domain="ui", message="Sorry, dematerialization is possible only if the external agency is defined.")\n
     raise ValidationFailed, (msg,)\n
-  if not \'encaisse_des_billets_retires_de_la_circulation\' in vault:\n
+\n
+  if \'encaisse_des_billets_retires_de_la_circulation\' not in vault:\n
     msg = Message(domain="ui", message="Invalid source.")\n
     raise ValidationFailed, (msg,)\n
+\n
   if source_section in source_object.getPath():\n
     msg = Message(domain="ui", message="You can\'t used this site.")\n
     raise ValidationFailed, (msg,)\n
@@ -117,7 +120,7 @@
 # Get price and total_price.\n
 amount = transaction.getSourceTotalAssetPrice()\n
 total_price = transaction.getTotalPrice(portal_type=[\'Monetary Destruction Line\',\'Monetary Destruction Cell\'],fast=0)\n
-resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Monetary Destruction Line\')\n
+resource = transaction.CashDelivery_checkCounterInventory(source=source_object.getPath(), portal_type=\'Monetary Destruction Line\')\n
 \n
 if resource == 2:\n
   msg = Message(domain="ui", message="No Resource.")\n
@@ -182,9 +185,8 @@
                             <string>_getitem_</string>
                             <string>transaction</string>
                             <string>_getattr_</string>
+                            <string>source_object</string>
                             <string>vault</string>
-                            <string>context</string>
-                            <string>source_object</string>
                             <string>msg</string>
                             <string>source_section</string>
                             <string>None</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/bt/revision?rev=24555&r1=24554&r2=24555&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_cash/bt/revision [utf8] Wed Nov 12 11:54:31 2008
@@ -1,1 +1,1 @@
-645
+646




More information about the Erp5-report mailing list