From c8dca993816b0b152a34e3c276aa713ceb69bb0e Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 22 Mar 2007 15:56:05 +0000
Subject: [PATCH] added specific z_create_stock

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13572 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../z_create_stock.catalog_keys.xml           |   5 +
 .../erp5_mysql_innodb/z_create_stock.xml      | 212 ++++++++++++++++++
 bt5/erp5_banking_core/bt/revision             |   2 +-
 .../bt/template_catalog_method_id_list        |   1 +
 4 files changed, 219 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.catalog_keys.xml
 create mode 100644 bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.xml

diff --git a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.catalog_keys.xml b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.catalog_keys.xml
new file mode 100644
index 0000000000..baf9e92bd9
--- /dev/null
+++ b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.catalog_keys.xml
@@ -0,0 +1,5 @@
+<catalog_method>
+ <item key="sql_clear_catalog" type="int">
+  <value>1</value>
+ </item>
+</catalog_method>
\ No newline at end of file
diff --git a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.xml b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.xml
new file mode 100644
index 0000000000..1966be98c0
--- /dev/null
+++ b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_stock.xml
@@ -0,0 +1,212 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ZSQLMethods.SQL</string>
+          <string>SQL</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_arg</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="Args" module="Shared.DC.ZRDB.Aqueduct"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_data</string> </key>
+                        <value>
+                          <dictionary/>
+                        </value>
+                    </item>
+                    <item>
+                        <key> <string>_keys</string> </key>
+                        <value>
+                          <list/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>allow_simple_one_argument_traversal</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>arguments_src</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>cache_time_</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>class_file_</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>class_name_</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>connection_hook</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>connection_id</string> </key>
+            <value> <string>erp5_sql_connection</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>z_create_stock</string> </value>
+        </item>
+        <item>
+            <key> <string>max_cache_</string> </key>
+            <value> <int>100</int> </value>
+        </item>
+        <item>
+            <key> <string>max_rows_</string> </key>
+            <value> <int>1000</int> </value>
+        </item>
+        <item>
+            <key> <string>src</string> </key>
+            <value> <string># Host:\n
+# Database: test\n
+# Table: \'stock\'\n
+#\n
+CREATE TABLE `stock` (\n
+  `uid` BIGINT UNSIGNED NOT NULL,\n
+  `node_uid` BIGINT UNSIGNED,\n
+  `section_uid` BIGINT UNSIGNED,\n
+  `payment_uid` BIGINT UNSIGNED,\n
+  `function_uid` BIGINT UNSIGNED,\n
+  `project_uid` BIGINT UNSIGNED,\n
+  `mirror_section_uid` BIGINT UNSIGNED,\n
+  `mirror_node_uid` BIGINT UNSIGNED,\n
+  `resource_uid` BIGINT UNSIGNED,\n
+  `quantity` real ,\n
+  `date` datetime,\n
+  `total_price` real ,\n
+  `portal_type` VARCHAR(255),\n
+  `simulation_state` varchar(255) default \'\',\n
+  `variation_text` VARCHAR(255),\n
+  `sub_variation_text` VARCHAR(255),\n
+  KEY `uid` (`uid`),\n
+  KEY `quantity` (`quantity`),\n
+  KEY `section_uid` (`section_uid`),\n
+  KEY `mirror_section_uid` (`mirror_section_uid`),\n
+  KEY `mirror_node_uid` (`mirror_node_uid`),\n
+  KEY `node_uid` (`node_uid`),\n
+  KEY `payment_uid` (`payment_uid`),\n
+  KEY `function_uid` (`function_uid`),\n
+  KEY `project_uid` (`project_uid`),\n
+  KEY `resource_uid` (`resource_uid`),\n
+  KEY `simulation_state` (`simulation_state`),\n
+  KEY `resource_node_uid` (`resource_uid`, `node_uid`),\n
+  KEY `resource_section_node_uid` (`resource_uid`, `section_uid`, `node_uid`, `simulation_state`)\n
+) TYPE = InnoDB;\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>template</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="SQL" module="Shared.DC.ZRDB.DA"/>
+                </klass>
+                <none/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>__name__</string> </key>
+                        <value> <string encoding="cdata"><![CDATA[
+
+<string>
+
+]]></string> </value>
+                    </item>
+                    <item>
+                        <key> <string>_vars</string> </key>
+                        <value>
+                          <dictionary/>
+                        </value>
+                    </item>
+                    <item>
+                        <key> <string>globals</string> </key>
+                        <value>
+                          <dictionary/>
+                        </value>
+                    </item>
+                    <item>
+                        <key> <string>raw</string> </key>
+                        <value> <string># Host:\n
+# Database: test\n
+# Table: \'stock\'\n
+#\n
+CREATE TABLE `stock` (\n
+  `uid` BIGINT UNSIGNED NOT NULL,\n
+  `node_uid` BIGINT UNSIGNED,\n
+  `section_uid` BIGINT UNSIGNED,\n
+  `payment_uid` BIGINT UNSIGNED,\n
+  `function_uid` BIGINT UNSIGNED,\n
+  `project_uid` BIGINT UNSIGNED,\n
+  `mirror_section_uid` BIGINT UNSIGNED,\n
+  `mirror_node_uid` BIGINT UNSIGNED,\n
+  `resource_uid` BIGINT UNSIGNED,\n
+  `quantity` real ,\n
+  `date` datetime,\n
+  `total_price` real ,\n
+  `portal_type` VARCHAR(255),\n
+  `simulation_state` varchar(255) default \'\',\n
+  `variation_text` VARCHAR(255),\n
+  `sub_variation_text` VARCHAR(255),\n
+  KEY `uid` (`uid`),\n
+  KEY `quantity` (`quantity`),\n
+  KEY `section_uid` (`section_uid`),\n
+  KEY `mirror_section_uid` (`mirror_section_uid`),\n
+  KEY `mirror_node_uid` (`mirror_node_uid`),\n
+  KEY `node_uid` (`node_uid`),\n
+  KEY `payment_uid` (`payment_uid`),\n
+  KEY `function_uid` (`function_uid`),\n
+  KEY `project_uid` (`project_uid`),\n
+  KEY `resource_uid` (`resource_uid`),\n
+  KEY `simulation_state` (`simulation_state`),\n
+  KEY `resource_node_uid` (`resource_uid`, `node_uid`),\n
+  KEY `resource_section_node_uid` (`resource_uid`, `section_uid`, `node_uid`, `simulation_state`)\n
+) TYPE = InnoDB;\n
+</string> </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision
index 7f3a7cc66c..5755659621 100644
--- a/bt5/erp5_banking_core/bt/revision
+++ b/bt5/erp5_banking_core/bt/revision
@@ -1 +1 @@
-161
\ No newline at end of file
+163
\ No newline at end of file
diff --git a/bt5/erp5_banking_core/bt/template_catalog_method_id_list b/bt5/erp5_banking_core/bt/template_catalog_method_id_list
index 426f20b690..e754b64f04 100644
--- a/bt5/erp5_banking_core/bt/template_catalog_method_id_list
+++ b/bt5/erp5_banking_core/bt/template_catalog_method_id_list
@@ -3,6 +3,7 @@ erp5_mysql_innodb/z_catalog_movement_list
 erp5_mysql_innodb/z_catalog_object_list
 erp5_mysql_innodb/z_catalog_stock_list
 erp5_mysql_innodb/z_create_catalog
+erp5_mysql_innodb/z_create_stock
 erp5_mysql_innodb/z_related_default_site
 erp5_mysql_innodb/z_related_destination_payment
 erp5_mysql_innodb/z_related_translated_simulation_state_title
\ No newline at end of file
-- 
2.30.9