[Erp5-report] r14675 - in /erp5/trunk/bt5/erp5_banking_check: PortalTypeBaseCategoryTemplat...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 4 10:59:12 CEST 2007


Author: aurel
Date: Mon Jun  4 10:59:12 2007
New Revision: 14675

URL: http://svn.erp5.org?rev=14675&view=rev
Log:
* user which did 'deliver action' is now record on object to prevent indexation pb if his assignment change in future
* check we pass wf transition with the user assigned at the same vault as the original one

Modified:
    erp5/trunk/bt5/erp5_banking_check/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
    erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckPayment_getBaobabSource.xml
    erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/traveler_check_purchase_workflow/scripts/validatePositionAccounting.xml
    erp5/trunk/bt5/erp5_banking_check/bt/revision
    erp5/trunk/bt5/erp5_banking_check/bt/template_portal_type_base_category_list

Modified: erp5/trunk/bt5/erp5_banking_check/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/PortalTypeBaseCategoryTemplateItem/base_category_list.xml?rev=14675&r1=14674&r2=14675&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/PortalTypeBaseCategoryTemplateItem/base_category_list.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/PortalTypeBaseCategoryTemplateItem/base_category_list.xml Mon Jun  4 10:59:12 2007
@@ -3,6 +3,7 @@
   <item>site</item>
  </portal_type>
  <portal_type id="Check Payment">
+  <item>source_trade</item>
   <item>aggregate_resource</item>
  </portal_type>
  <portal_type id="Checkbook Delivery">
@@ -14,12 +15,12 @@
   <item>currency_exchange_type</item>
  </portal_type>
  <portal_type id="Checkbook Reception Line">
+  <item>check_type</item>
   <item>check_amount</item>
-  <item>check_type</item>
  </portal_type>
  <portal_type id="Stop Payment">
+  <item>currency_exchange_type</item>
   <item>aggregate_resource</item>
-  <item>currency_exchange_type</item>
  </portal_type>
  <portal_type id="Traveler Check Purchase">
   <item>currency_exchange_type</item>

Modified: erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckPayment_getBaobabSource.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckPayment_getBaobabSource.xml?rev=14675&r1=14674&r2=14675&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckPayment_getBaobabSource.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckPayment_getBaobabSource.xml Mon Jun  4 10:59:12 2007
@@ -65,16 +65,21 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>user_id = context.Base_getLastUserIdByTransition(workflow_id=\'check_payment_workflow\', transition_id=\'deliver_action\')\n
-if user_id is None:\n
-  return None\n
-site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
-source = context.getSource()\n
-for site in site_list:\n
-  site_value = context.portal_categories.getCategoryValue(site)\n
-  if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
-    return site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
-return None\n
+            <value> <string>source_trade = context.getSourceTrade()\n
+if source_trade is None:\n
+  user_id = context.Base_getLastUserIdByTransition(workflow_id=\'check_payment_workflow\', transition_id=\'deliver_action\')\n
+  if user_id is not None:\n
+    site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
+    source = context.getSource()\n
+    for site in site_list:\n
+      site_value = context.portal_categories.getCategoryValue(site)\n
+      if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
+        source_trade = site + \'/encaisse_des_billets_et_monnaies/sortante\'\n
+        # Save it only once we are sure that the document will not change any more\n
+        # and that we will not have many users trying to do deliver_action\n
+        if context.getSimulationState() == \'delivered\':\n
+          context.setSourceTrade(source_trade)\n
+return source_trade\n
 </string> </value>
         </item>
         <item>
@@ -126,8 +131,9 @@
                             <string>kw</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>source_trade</string>
+                            <string>None</string>
                             <string>user_id</string>
-                            <string>None</string>
                             <string>site_list</string>
                             <string>source</string>
                             <string>_getiter_</string>

Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/traveler_check_purchase_workflow/scripts/validatePositionAccounting.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/traveler_check_purchase_workflow/scripts/validatePositionAccounting.xml?rev=14675&r1=14674&r2=14675&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/traveler_check_purchase_workflow/scripts/validatePositionAccounting.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/traveler_check_purchase_workflow/scripts/validatePositionAccounting.xml Mon Jun  4 10:59:12 2007
@@ -77,6 +77,9 @@
 if source is None:\n
   msg = Message(domain=\'ui\', message=\'No counter defined.\')\n
   raise ValidationFailed, (msg,)\n
+\n
+# check we don\'t change of user\n
+transaction.Baobab_checkSameUserVault(source)\n
 \n
 # check we are in an opened accounting day\n
 if not transaction.Baobab_checkCounterDateOpen(site=source, date=date):\n
@@ -199,6 +202,7 @@
                             <string>item</string>
                             <string>category_list</string>
                             <string>base_price</string>
+                            <string>_inplacevar_</string>
                             <string>round</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_banking_check/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/bt/revision?rev=14675&r1=14674&r2=14675&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/revision Mon Jun  4 10:59:12 2007
@@ -1,1 +1,1 @@
-268
+270

Modified: erp5/trunk/bt5/erp5_banking_check/bt/template_portal_type_base_category_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/bt/template_portal_type_base_category_list?rev=14675&r1=14674&r2=14675&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/template_portal_type_base_category_list (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/template_portal_type_base_category_list Mon Jun  4 10:59:12 2007
@@ -1,5 +1,6 @@
 Check Deposit | site
 Check Payment | aggregate_resource
+Check Payment | source_trade
 Checkbook Delivery Line | check_amount
 Checkbook Delivery Line | check_type
 Checkbook Delivery Line | currency_exchange_type




More information about the Erp5-report mailing list