Commit f7aa26bf authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_mysql_innodb_catalog: Make movement deletion transactional in catalog.

Inventory API has minimal catalog table usage (join on uid  only), which
makes on-deletion catalog changes insufficient to make movements
disappear transactionally from Inventory API results.
As it may be expected that a set of movements deleted during a single
transaction are atomically removed from Inventory API results, also
change stock table.
parent 2eb560f6
...@@ -58,7 +58,15 @@ REPLACE INTO\n ...@@ -58,7 +58,15 @@ REPLACE INTO\n
catalog (uid, path,relative_url,security_uid,portal_type,parent_uid)\n catalog (uid, path,relative_url,security_uid,portal_type,parent_uid)\n
VALUES\n VALUES\n
(<dtml-sqlvar uid type="int">, \'deleted\',\'\',NULL,\'\',NULL)\n (<dtml-sqlvar uid type="int">, \'deleted\',\'\',NULL,\'\',NULL)\n
<dtml-comment>\n
Note on "UPDATE stock" query: this query preserve transactionality of movement\n
deletion: all movements deleted in a single transaction will be either\n
simultaneously found by Inventory Tool API, or simultaneously not found.\n
This does not change anything WRT inventories, modulo unindexation lag.\n
</dtml-comment>\n
UPDATE stock\n
SET simulation_state=\'\'\n
WHERE uid=<dtml-sqlvar uid type="int">\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
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