Commit b0575af9 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

PythonScript: fix Zope2 compatibility

There is no zmi_icon on Zope2.
parent 82f885b7
...@@ -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,7 +72,8 @@ class PythonScript(XMLObject, ZopePythonScript, ExpressionMixin('expression')): ...@@ -71,7 +72,8 @@ 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
zmi_icon = ZopePythonScript.zmi_icon if not IS_ZOPE2:
zmi_icon = ZopePythonScript.zmi_icon
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
......
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