Commit b8cbf53d authored by Jérome Perrin's avatar Jérome Perrin

PythonScript: fix Zope2 compatibility

There is no zmi_icon on Zope2.
parent c0110369
...@@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo ...@@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from App.special_dtml import HTMLFile from App.special_dtml import HTMLFile
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type import IS_ZOPE2
from Products.PythonScripts.PythonScript import \ from Products.PythonScripts.PythonScript import \
PythonScript as ZopePythonScript PythonScript as ZopePythonScript
from Products.ERP5Type.mixin.expression import ExpressionMixin from Products.ERP5Type.mixin.expression import ExpressionMixin
...@@ -71,6 +72,7 @@ class PythonScript(XMLObject, ZopePythonScript, ExpressionMixin('expression')): ...@@ -71,6 +72,7 @@ class PythonScript(XMLObject, ZopePythonScript, ExpressionMixin('expression')):
meta_type = 'ERP5 Python Script' meta_type = 'ERP5 Python Script'
portal_type = 'Python Script' portal_type = 'Python Script'
add_permission = Permissions.AddPortalContent add_permission = Permissions.AddPortalContent
if not IS_ZOPE2:
zmi_icon = ZopePythonScript.zmi_icon zmi_icon = ZopePythonScript.zmi_icon
# Declarative security # Declarative security
......
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