Commit b2d624ae authored by Titouan Soulard's avatar Titouan Soulard

erp5_mysql_innodb_catalog: index Inventory movements with default `z_catalog_stock_list`

…and delete unused `z_catalog_stock_list_without_delete_for_inventory_virtual_movement`
parent 8534ca7e
Pipeline #38678 failed with stage
in 0 seconds
......@@ -71,7 +71,7 @@ asMovementList</string> </value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.providesIMovement() and not context.isInventoryMovement()</string> </value>
<value> <string>python: context.providesIMovement()</string> </value>
</item>
<item>
<key> <string>expression_cache_key</string> </key>
......
<dtml-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and getResourceUid[loop_item]">
<dtml-if "getDestinationUid[loop_item]">
<dtml-call expr="row_list.append([
uid[loop_item],
order_id[loop_item],
getExplanationUid[loop_item],
getDestinationUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationPaymentUid[loop_item],
getDestinationFunctionUid[loop_item],
getDestinationProjectUid[loop_item],
getDestinationFundingUid[loop_item],
getLedgerUid[loop_item],
getDestinationPaymentRequestUid[loop_item],
getSourceSectionUid[loop_item],
getSourceUid[loop_item],
getResourceUid[loop_item],
getInventoriatedQuantity[loop_item],
isCancellationAmount[loop_item],
isAccountable[loop_item],
getStopDate[loop_item],
getStartDate[loop_item],
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item],
0,
])">
</dtml-if>
<dtml-if "getSourceUid[loop_item]">
<dtml-call expr="row_list.append([
uid[loop_item],
mirror_order_id[loop_item],
getExplanationUid[loop_item],
getSourceUid[loop_item],
getSourceSectionUid[loop_item],
getSourcePaymentUid[loop_item],
getSourceFunctionUid[loop_item],
getSourceProjectUid[loop_item],
getSourceFundingUid[loop_item],
getLedgerUid[loop_item],
getSourcePaymentRequestUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationUid[loop_item],
getResourceUid[loop_item],
-(getInventoriatedQuantity[loop_item] or 0),
isCancellationAmount[loop_item],
isAccountable[loop_item],
getStartDate[loop_item],
getStopDate[loop_item],
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item],
1,
])">
</dtml-if>
</dtml-if>
</dtml-in>
<dtml-if "row_list">
INSERT INTO
stock
VALUES
<dtml-in prefix="row" expr="row_list">
(
<dtml-sqlvar expr="row_item[0]" type="int">,
<dtml-sqlvar expr="row_item[1]" type="int">,
<dtml-sqlvar expr="row_item[2]" type="int" optional>,
<dtml-sqlvar expr="row_item[3]" type="int">,
<dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="int" optional>,
<dtml-sqlvar expr="row_item[6]" type="int" optional>,
<dtml-sqlvar expr="row_item[7]" type="int" optional>,
<dtml-sqlvar expr="row_item[8]" type="int" optional>,
<dtml-sqlvar expr="row_item[9]" type="int" optional>,
<dtml-sqlvar expr="row_item[10]" type="int" optional>,
<dtml-sqlvar expr="row_item[11]" type="int" optional>,
<dtml-sqlvar expr="row_item[12]" type="int" optional>,
<dtml-sqlvar expr="row_item[13]" type="int">,
<dtml-sqlvar expr="row_item[14]" type="float" optional>,
<dtml-sqlvar expr="row_item[15]" type="int">,
<dtml-sqlvar expr="row_item[16]" type="int">,
<dtml-sqlvar expr="row_item[17]" type="datetime" optional>,
<dtml-sqlvar expr="row_item[18]" type="datetime" optional>,
<dtml-sqlvar expr="row_item[19]" type="float" optional>,
<dtml-sqlvar expr="row_item[20]" type="string" optional>,
<dtml-sqlvar expr="row_item[21]" type="string" optional>,
<dtml-sqlvar expr="row_item[22]" type="string" optional>,
<dtml-sqlvar expr="row_item[23]" type="string" optional>,
<dtml-sqlvar expr="row_item[24]" type="int">
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL Method" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\n
order_id\n
mirror_order_id\n
getExplanationUid\n
getResourceUid\n
getInventoriatedQuantity\n
getSourceUid\n
getDestinationUid\n
getSourceSectionUid\n
getDestinationSectionUid\n
isMovement\n
isCancellationAmount\n
isInventoryMovement\n
getSourcePaymentUid\n
getDestinationPaymentUid\n
getSourceFunctionUid\n
getDestinationFunctionUid\n
getSourceProjectUid\n
getDestinationProjectUid\n
getSourceFundingUid\n
getDestinationFundingUid\n
getLedgerUid\n
getSourcePaymentRequestUid\n
getDestinationPaymentRequestUid\n
getSimulationState\n
getSourceInventoriatedTotalAssetPrice\n
getDestinationInventoriatedTotalAssetPrice\n
getStartDate\n
getStopDate\n
isAccountable\n
getPortalType\n
getVariationText\n
getSubVariationText</string> </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_catalog_stock_list_without_delete_for_inventory_virtual_movement</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>SQL Method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -57,7 +57,6 @@ erp5_mysql_innodb/z_catalog_predicate_list
erp5_mysql_innodb/z_catalog_quantity_unit_conversion_list
erp5_mysql_innodb/z_catalog_roles_and_users_list
erp5_mysql_innodb/z_catalog_stock_list
erp5_mysql_innodb/z_catalog_stock_list_without_delete_for_inventory_virtual_movement
erp5_mysql_innodb/z_catalog_subject_list
erp5_mysql_innodb/z_catalog_transformation_list
erp5_mysql_innodb/z_catalog_translation_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment