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

External method to change workflow state variable on Career documents



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17171 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 24e6f594
from Globals import get_request
from Acquisition import aq_base
from Globals import PersistentMapping
from Products.CMFCore.utils import getToolByName
def fixProductNames(self, REQUEST=None):
msg = ''
portal_types = getToolByName(self, 'portal_types')
......@@ -81,3 +84,18 @@ def updateBalanceTransactionClass(self):
# reindexing after ...
newobj.activate(after_method_id='unindexObject').recursiveReindexObject()
def updateCareerValidationState(self):
"""Career workflow changed its state variable name in r17169
"""
module = self.getPortalObject().person_module
for person in self.getPortalObject().person_module.contentValues(
filter=dict(portal_type='Person')):
for career in person.contentValues(filter=dict(portal_type='Career')):
if getattr(aq_base(career), 'workflow_history', None) is None:
continue
for line in career.workflow_history['career_workflow']:
if 'state' in line:
line['validation_state'] = line.pop('state')
career.reindexObject()
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