From 583876d6b9ee62c68fb2937c6740f1b96690341d Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Wed, 30 Nov 2005 15:22:37 +0000 Subject: [PATCH] Patch StateDefinition to support state types. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4430 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/ZopePatch.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/product/ERP5Type/ZopePatch.py b/product/ERP5Type/ZopePatch.py index 484b1c5d54..7b762fb994 100755 --- a/product/ERP5Type/ZopePatch.py +++ b/product/ERP5Type/ZopePatch.py @@ -2164,7 +2164,30 @@ if PropertiedUser is not None: PropertiedUser.getRolesInContext = getRolesInContext PropertiedUser.allowed = allowed +############################################################################ +# State types patch for DCWorkflow +from Products.DCWorkflow.States import StateDefinition +_properties_form = DTMLFile('dtml/state_properties', globals()) - - +def getAvailableTypeList(self): + """This is a method specific to ERP5. This returns a list of state types, which are used for portal methods. + """ + return ('current_inventory', 'reserved_inventory', 'future_inventory', + 'draft_order', 'planned_order', ) + +def setProperties(self, title='', transitions=(), REQUEST=None, description='', type_list=()): + ''' + ''' + self.title = str(title) + self.description = str(description) + self.transitions = tuple(map(str, transitions)) + # This is patched by yo. + self.type_list = tuple(type_list) + if REQUEST is not None: + return self.manage_properties(REQUEST, 'Properties changed.') + +StateDefinition._properties_form = _properties_form +StateDefinition.getAvailableTypeList = getAvailableTypeList +StateDefinition.setProperties = setProperties +StateDefinition.type_list = () \ No newline at end of file -- 2.30.9