[Erp5-report] r19835 - in /erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog: Ca...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 12 18:47:42 CET 2008


Author: alex
Date: Wed Mar 12 18:47:41 2008
New Revision: 19835

URL: http://svn.erp5.org?rev=19835&view=rev
Log:
When cataloging movements, delete then insert instead of replacing, as some objects might not be movements anylonger.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_movement_list.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_movement_list.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_movement_list.xml?rev=19835&r1=19834&r2=19835&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_movement_list.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_movement_list.xml Wed Mar 12 18:47:41 2008
@@ -3,11 +3,8 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.ZSQLMethods.SQL</string>
-          <string>SQL</string>
-        </tuple>
-        <none/>
+        <global name="SQL" module="Products.ZSQLMethods.SQL"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
@@ -129,21 +126,21 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>isMovement</string>
-                            <string>uid</string>
-                            <string>getExplanationUid</string>
-                            <string>getSourceUid</string>
-                            <string>getDestinationUid</string>
-                            <string>getResourceUid</string>
-                            <string>getInventoriatedQuantity</string>
-                            <string>getStartDate</string>
-                            <string>getStopDate</string>
-                            <string>getPrice</string>
-                            <string>isAccountable</string>
-                            <string>isOrderable</string>
-                            <string>isDeliverable</string>
-                            <string>isDivergent</string>
-                            <string>getVariationText</string>
+<string>isMovement</string>
+<string>uid</string>
+<string>getExplanationUid</string>
+<string>getSourceUid</string>
+<string>getDestinationUid</string>
+<string>getResourceUid</string>
+<string>getInventoriatedQuantity</string>
+<string>getStartDate</string>
+<string>getStopDate</string>
+<string>getPrice</string>
+<string>isAccountable</string>
+<string>isOrderable</string>
+<string>isDeliverable</string>
+<string>isDivergent</string>
+<string>getVariationText</string>
                           </list>
                         </value>
                     </item>
@@ -214,14 +211,22 @@
             <key> <string>src</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
-<dtml-let movement_list="[]">\n
+DELETE FROM\n
+  movement\n
+WHERE\n
+<dtml-in uid>\n
+  uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
+</dtml-in>\n
+;\n
+\n
+<dtml-var "\'\\0\'"><dtml-let movement_list="[]">\n
   <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
     <dtml-if "isMovement[loop_item]">\n
       <dtml-call expr="movement_list.append(loop_item)">\n
     </dtml-if>\n
   </dtml-in>\n
   <dtml-if expr="_.len(movement_list) > 0">\n
-REPLACE INTO\n
+INSERT INTO\n
   movement\n
 VALUES\n
     <dtml-in prefix="loop" expr="movement_list">\n
@@ -254,9 +259,11 @@
             <value>
               <object>
                 <klass>
+                  <global name="__newobj__" module="copy_reg"/>
+                </klass>
+                <tuple>
                   <global name="SQL" module="Shared.DC.ZRDB.DA"/>
-                </klass>
-                <none/>
+                </tuple>
                 <state>
                   <dictionary>
                     <item>
@@ -283,14 +290,22 @@
                         <key> <string>raw</string> </key>
                         <value> <string encoding="cdata"><![CDATA[
 
-<dtml-let movement_list="[]">\n
+DELETE FROM\n
+  movement\n
+WHERE\n
+<dtml-in uid>\n
+  uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
+</dtml-in>\n
+;\n
+\n
+<dtml-var "\'\\0\'"><dtml-let movement_list="[]">\n
   <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
     <dtml-if "isMovement[loop_item]">\n
       <dtml-call expr="movement_list.append(loop_item)">\n
     </dtml-if>\n
   </dtml-in>\n
   <dtml-if expr="_.len(movement_list) > 0">\n
-REPLACE INTO\n
+INSERT INTO\n
   movement\n
 VALUES\n
     <dtml-in prefix="loop" expr="movement_list">\n

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision?rev=19835&r1=19834&r2=19835&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision Wed Mar 12 18:47:41 2008
@@ -1,1 +1,1 @@
-99
+100




More information about the Erp5-report mailing list