Commit 49e44f94 authored by Jérome Perrin's avatar Jérome Perrin

Clear the cache when validating a preference

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6885 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b5269f60
...@@ -66,10 +66,13 @@ ...@@ -66,10 +66,13 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>pref = sci.object\n <value> <string>from Products.ERP5Type.Cache import clearCache\n
from Products.ERP5Type.Message import Message\n
\n
pref = sci.object\n
portal = sci.getPortal()\n portal = sci.getPortal()\n
LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n
N_ = context.Base_translateString\n N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
\n \n
# deactivate all other preferences of the same level \n # deactivate all other preferences of the same level \n
for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
...@@ -82,11 +85,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n ...@@ -82,11 +85,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
p.portal_workflow.doActionFor(p,\n p.portal_workflow.doActionFor(p,\n
\'disable_action\',\n \'disable_action\',\n
wf_id=\'preference_workflow\', \n wf_id=\'preference_workflow\', \n
comment=N_(\'automatically disabled when enabling ${preference_title}\',\n comment=N_(\'Automatically disabled when enabling ${preference_title}\',\n
mapping={\'preference_title\': context.getTitle()}) )\n mapping={\'preference_title\': context.getTitle()}) )\n
LOG(\'Deactivated %s\'%p)\n
except \'Unauthorized\', a :\n except \'Unauthorized\', a :\n
LOG("not authorized to deactivate %s"%p)\n LOG("not authorized to deactivate %s"%p)\n
\n
clearCache(method_id="PreferenceTool.CachingMethod.")\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -140,14 +144,18 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n ...@@ -140,14 +144,18 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
<value> <value>
<tuple> <tuple>
<string>sci</string> <string>sci</string>
<string>Products.ERP5Type.Cache</string>
<string>clearCache</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>pref</string> <string>pref</string>
<string>portal</string> <string>portal</string>
<string>LOG</string> <string>LOG</string>
<string>context</string>
<string>N_</string> <string>N_</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>p</string> <string>p</string>
<string>context</string>
<string>a</string> <string>a</string>
</tuple> </tuple>
</value> </value>
......
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