Commit 9a96bd86 authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_stock_cache: Allow easy stock cache disabling.

Disable stock cache by removing erp5_syock_cache from skin selection.
parent 8ed0408b
......@@ -52,6 +52,10 @@
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Errors import ProgrammingError\n
\n
zTrimInventoryCacheFromDateOnCatalog = getattr(context, \'SimulationTool_zTrimInventoryCacheFromDateOnCatalog\', None)\n
if zTrimInventoryCacheFromDateOnCatalog is None:\n
return\n
\n
min_date = None\n
for loop_item in xrange(len(uid)):\n
if not isInventoryMovement[loop_item] and isMovement[loop_item] and getResourceUid[loop_item]:\n
......@@ -67,7 +71,7 @@ for loop_item in xrange(len(uid)):\n
min_date = getStartDate[loop_item]\n
\n
try:\n
context.SimulationTool_zTrimInventoryCacheFromDateOnCatalog(uid_list=uid, min_date=min_date)\n
zTrimInventoryCacheFromDateOnCatalog(uid_list=uid, min_date=min_date)\n
except ProgrammingError:\n
# Create table if it does not exits\n
# Then no need to flush an empty table\n
......
......@@ -52,8 +52,12 @@
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Errors import ProgrammingError\n
\n
zTrimInventoryCacheFromDateOnUncatalog = getattr(context, \'SimulationTool_zTrimInventoryCacheFromDateOnUncatalog\', None)\n
if zTrimInventoryCacheFromDateOnUncatalog is None:\n
return\n
\n
try:\n
context.SimulationTool_zTrimInventoryCacheFromDateOnUncatalog(uid=uid)\n
zTrimInventoryCacheFromDateOnUncatalog(uid=uid)\n
except ProgrammingError:\n
# Create table if it does not exits\n
# Then no need to flush an empty table\n
......
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