diff --git a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
index cd0ffb5bb6110f585cac71e906d8698081085944..8d8ff107ef49f08075df918c6479ee9c5f7a7b80 100644
--- a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
+++ b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
@@ -277,21 +277,17 @@ WHERE\n
 \n
 <dtml-var "\'\\0\'">\n
 \n
-<dtml-let row_list="[]">\n
+<dtml-let row_list="[]" uid_dict="{}">\n
   <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
-    <dtml-if "isMovement[loop_item]">\n
-    <dtml-if "not isInventoryMovement[loop_item]">\n
-      <dtml-if "isAccountable[loop_item]">\n
-        <dtml-if "getResourceUid[loop_item]">\n
-          <dtml-if "getBaobabDestinationUid[loop_item]">\n
-            <dtml-call expr="row_list.append([uid[loop_item], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n
-          </dtml-if>\n
-          <dtml-if "getBaobabSourceUid[loop_item]">\n
-            <dtml-call expr="row_list.append([uid[loop_item], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n
-          </dtml-if>\n
-        </dtml-if>\n
+    <dtml-if "not isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
+      <dtml-if "getBaobabDestinationUid[loop_item]">\n
+        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
+        <dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n
+      </dtml-if>\n
+      <dtml-if "getBaobabSourceUid[loop_item]">\n
+        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
+        <dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n
       </dtml-if>\n
-    </dtml-if>\n
     </dtml-if>\n
   </dtml-in>  \n
   \n
@@ -302,20 +298,21 @@ VALUES\n
     <dtml-in prefix="row" expr="row_list">\n
 (\n
   <dtml-sqlvar expr="row_item[0]" type="int">,\n
-  <dtml-sqlvar expr="row_item[1]" type="int">,  \n
-  <dtml-sqlvar expr="row_item[2]" type="int" optional>, \n
-  <dtml-sqlvar expr="row_item[3]" type="int" optional>,\n
+  <dtml-sqlvar expr="row_item[1]" type="int">,\n
+  <dtml-sqlvar expr="row_item[2]" type="int">,  \n
+  <dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
   <dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
   <dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
   <dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
-  <dtml-sqlvar expr="row_item[7]" type="int">, \n
-  <dtml-sqlvar expr="row_item[8]" type="float" optional>,\n
-  <dtml-sqlvar expr="row_item[9]" type="datetime" optional>,\n
-  <dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
-  <dtml-sqlvar expr="row_item[11]" type="string" optional>,\n
+  <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
+  <dtml-sqlvar expr="row_item[8]" type="int">, \n
+  <dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
+  <dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
+  <dtml-sqlvar expr="row_item[11]" type="float" optional>,\n
   <dtml-sqlvar expr="row_item[12]" type="string" optional>,\n
   <dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
-  <dtml-sqlvar expr="row_item[14]" type="string" optional>\n
+  <dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
+  <dtml-sqlvar expr="row_item[15]" type="string" optional>\n
 )\n
 <dtml-if sequence-end><dtml-else>,</dtml-if>\n
     </dtml-in>\n
@@ -371,21 +368,17 @@ WHERE\n
 \n
 <dtml-var "\'\\0\'">\n
 \n
-<dtml-let row_list="[]">\n
+<dtml-let row_list="[]" uid_dict="{}">\n
   <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
-    <dtml-if "isMovement[loop_item]">\n
-    <dtml-if "not isInventoryMovement[loop_item]">\n
-      <dtml-if "isAccountable[loop_item]">\n
-        <dtml-if "getResourceUid[loop_item]">\n
-          <dtml-if "getBaobabDestinationUid[loop_item]">\n
-            <dtml-call expr="row_list.append([uid[loop_item], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n
-          </dtml-if>\n
-          <dtml-if "getBaobabSourceUid[loop_item]">\n
-            <dtml-call expr="row_list.append([uid[loop_item], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n
-          </dtml-if>\n
-        </dtml-if>\n
+    <dtml-if "not isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
+      <dtml-if "getBaobabDestinationUid[loop_item]">\n
+        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
+        <dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n
+      </dtml-if>\n
+      <dtml-if "getBaobabSourceUid[loop_item]">\n
+        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
+        <dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n
       </dtml-if>\n
-    </dtml-if>\n
     </dtml-if>\n
   </dtml-in>  \n
   \n
@@ -396,20 +389,21 @@ VALUES\n
     <dtml-in prefix="row" expr="row_list">\n
 (\n
   <dtml-sqlvar expr="row_item[0]" type="int">,\n
-  <dtml-sqlvar expr="row_item[1]" type="int">,  \n
-  <dtml-sqlvar expr="row_item[2]" type="int" optional>, \n
-  <dtml-sqlvar expr="row_item[3]" type="int" optional>,\n
+  <dtml-sqlvar expr="row_item[1]" type="int">,\n
+  <dtml-sqlvar expr="row_item[2]" type="int">,  \n
+  <dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
   <dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
   <dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
   <dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
-  <dtml-sqlvar expr="row_item[7]" type="int">, \n
-  <dtml-sqlvar expr="row_item[8]" type="float" optional>,\n
-  <dtml-sqlvar expr="row_item[9]" type="datetime" optional>,\n
-  <dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
-  <dtml-sqlvar expr="row_item[11]" type="string" optional>,\n
+  <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
+  <dtml-sqlvar expr="row_item[8]" type="int">, \n
+  <dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
+  <dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
+  <dtml-sqlvar expr="row_item[11]" type="float" optional>,\n
   <dtml-sqlvar expr="row_item[12]" type="string" optional>,\n
   <dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
-  <dtml-sqlvar expr="row_item[14]" type="string" optional>\n
+  <dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
+  <dtml-sqlvar expr="row_item[15]" type="string" optional>\n
 )\n
 <dtml-if sequence-end><dtml-else>,</dtml-if>\n
     </dtml-in>\n
diff --git a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_category.xml b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_category.xml
index cbcf5e914bc027a5d99ec21a6af36abb9d660def..e79778d4d2d4bbcdf21fae8eddca27ba5a8a7844 100644
--- a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_category.xml
+++ b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_category.xml
@@ -99,7 +99,7 @@
   `category_uid` BIGINT UNSIGNED default \'0\',\n
   `base_category_uid` BIGINT UNSIGNED default \'0\',\n
   `category_strict_membership` tinyint(1) default \'0\',\n
-  KEY `uid` (`uid`),\n
+  PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
   KEY `Membership` (`category_uid`,`base_category_uid`)\n
 ) TYPE = InnoDB;</string> </value>
         </item>
@@ -142,7 +142,7 @@
   `category_uid` BIGINT UNSIGNED default \'0\',\n
   `base_category_uid` BIGINT UNSIGNED default \'0\',\n
   `category_strict_membership` tinyint(1) default \'0\',\n
-  KEY `uid` (`uid`),\n
+  PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
   KEY `Membership` (`category_uid`,`base_category_uid`)\n
 ) TYPE = InnoDB;</string> </value>
                     </item>
diff --git a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_item.xml b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_item.xml
index 0ce12272c07eb7e29deb652d151071b6a4ecc217..644536f70692703a5e47dcaa1263928da9551596 100644
--- a/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_item.xml
+++ b/bt5/erp5_banking_core/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_item.xml
@@ -107,7 +107,7 @@ CREATE TABLE `item` (\n
   `aggregate_uid` BIGINT UNSIGNED default \'0\',\n
   `variation_text` VARCHAR(255),\n
   `simulation_state` VARCHAR(255) default \'\',\n
-  KEY `uid` (`uid`),\n
+  PRIMARY KEY (`uid`, `aggregate_uid`),\n
   KEY `section_uid` (`section_uid`),\n
   KEY `resource_uid` (`resource_uid`),\n
   KEY `variation_text` (`variation_text`),\n
@@ -164,7 +164,7 @@ CREATE TABLE `item` (\n
   `aggregate_uid` BIGINT UNSIGNED default \'0\',\n
   `variation_text` VARCHAR(255),\n
   `simulation_state` VARCHAR(255) default \'\',\n
-  KEY `uid` (`uid`),\n
+  PRIMARY KEY (`uid`, `aggregate_uid`),\n
   KEY `section_uid` (`section_uid`),\n
   KEY `resource_uid` (`resource_uid`),\n
   KEY `variation_text` (`variation_text`),\n
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
index 0e0df5ca88bb608074dff815300a682d5bf5f2d3..6fe9b0d6fde256b23b1659a5c0156f85dff6f4d6 100644
--- 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
@@ -94,6 +94,7 @@
 #\n
 CREATE TABLE `stock` (\n
   `uid` BIGINT UNSIGNED NOT NULL,\n
+  `order_id` TINYINT UNSIGNED NOT NULL,\n
   `node_uid` BIGINT UNSIGNED,\n
   `section_uid` BIGINT UNSIGNED,\n
   `payment_uid` BIGINT UNSIGNED,\n
@@ -108,7 +109,7 @@ CREATE TABLE `stock` (\n
   `simulation_state` varchar(255) default \'\',\n
   `variation_text` VARCHAR(255),\n
   `sub_variation_text` VARCHAR(255),\n
-  KEY `uid` (`uid`),\n
+  PRIMARY KEY (`uid`, `order_id`),\n
   KEY `quantity` (`quantity`),\n
   KEY `section_uid` (`section_uid`),\n
   KEY `node_uid` (`node_uid`),\n
@@ -165,6 +166,7 @@ CREATE TABLE `stock` (\n
 #\n
 CREATE TABLE `stock` (\n
   `uid` BIGINT UNSIGNED NOT NULL,\n
+  `order_id` TINYINT UNSIGNED NOT NULL,\n
   `node_uid` BIGINT UNSIGNED,\n
   `section_uid` BIGINT UNSIGNED,\n
   `payment_uid` BIGINT UNSIGNED,\n
@@ -179,7 +181,7 @@ CREATE TABLE `stock` (\n
   `simulation_state` varchar(255) default \'\',\n
   `variation_text` VARCHAR(255),\n
   `sub_variation_text` VARCHAR(255),\n
-  KEY `uid` (`uid`),\n
+  PRIMARY KEY (`uid`, `order_id`),\n
   KEY `quantity` (`quantity`),\n
   KEY `section_uid` (`section_uid`),\n
   KEY `node_uid` (`node_uid`),\n
diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision
index b14de3adc47a49e932842fd4ce215e9bb81357c5..8d73f9387c81659b6eed501584b85a156d1f9a83 100644
--- a/bt5/erp5_banking_core/bt/revision
+++ b/bt5/erp5_banking_core/bt/revision
@@ -1 +1 @@
-421
\ No newline at end of file
+422