Commit d96144a9 authored by wenjie.zheng's avatar wenjie.zheng

Workflow.py: add isInfoSupported to class Workflow.

parent ee4588fd
...@@ -56,6 +56,7 @@ from Acquisition import aq_base ...@@ -56,6 +56,7 @@ from Acquisition import aq_base
from DateTime import DateTime from DateTime import DateTime
from zLOG import LOG, ERROR, DEBUG, WARNING from zLOG import LOG, ERROR, DEBUG, WARNING
from Products.CMFCore.Expression import Expression from Products.CMFCore.Expression import Expression
from Products.ERP5Type.Cache import CachingMethod
class Workflow(XMLObject): class Workflow(XMLObject):
""" """
...@@ -199,6 +200,18 @@ class Workflow(XMLObject): ...@@ -199,6 +200,18 @@ class Workflow(XMLObject):
return 1 return 1
return 0 return 0
security.declarePrivate('isInfoSupported')
def isInfoSupported(self, ob, name):
'''
Returns a true value if the given info name is supported.
'''
if name == self.getStateBaseCategory():
return 1
vdef = self.contentValues(portal_type='Variable').get(name, None)
if vdef is None:
return 0
return 1
def _checkTransitionGuard(self, tdef, document, **kw): def _checkTransitionGuard(self, tdef, document, **kw):
guard = tdef.getGuard() guard = tdef.getGuard()
if guard is None: if guard is None:
......
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