diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/preference_workflow/scripts/disableOtherPreferences.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/preference_workflow/scripts/disableOtherPreferences.xml index 69739c4f3665d0ed880ff0bbbcbfab112c4deec1..1c68d83757e360077085fec591eb53b24268fa0a 100644 --- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/preference_workflow/scripts/disableOtherPreferences.xml +++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/preference_workflow/scripts/disableOtherPreferences.xml @@ -66,10 +66,13 @@ </item> <item> <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 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 # deactivate all other preferences of the same level \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 p.portal_workflow.doActionFor(p,\n \'disable_action\',\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 - LOG(\'Deactivated %s\'%p)\n except \'Unauthorized\', a :\n LOG("not authorized to deactivate %s"%p)\n +\n +clearCache(method_id="PreferenceTool.CachingMethod.")\n </string> </value> </item> <item> @@ -140,14 +144,18 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n <value> <tuple> <string>sci</string> + <string>Products.ERP5Type.Cache</string> + <string>clearCache</string> + <string>Products.ERP5Type.Message</string> + <string>Message</string> <string>_getattr_</string> <string>pref</string> <string>portal</string> <string>LOG</string> - <string>context</string> <string>N_</string> <string>_getiter_</string> <string>p</string> + <string>context</string> <string>a</string> </tuple> </value>