Commit 13520801 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: Use new API.

parent 86985db3
...@@ -13,7 +13,7 @@ section_portal_type_list = ['Person', 'Organisation'] ...@@ -13,7 +13,7 @@ section_portal_type_list = ['Person', 'Organisation']
invalid_state_list = ['invalidated', 'deleted'] invalid_state_list = ['invalidated', 'deleted']
# first of all, validate the transaction itself # first of all, validate the transaction itself
container.validateTransaction(state_change) container.getScriptValueByReference('validateTransaction')(state_change)
# Check that all lines uses open accounts, and doesn't use invalid third # Check that all lines uses open accounts, and doesn't use invalid third
......
return sci.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](sci) return sci.getPortal().portal_workflow.accounting_workflow.getScriptValueByReference(script.getReference())(sci)
return sci.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](sci) return sci.getPortal().portal_workflow.accounting_workflow.getScriptValueByReference(script.getReference())(sci)
return state_change.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](state_change) return state_change.getPortal().portal_workflow.accounting_workflow.getScriptValueByReference(script.getReference())(state_change)
return state_change.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](state_change) return state_change.getPortal().portal_workflow.accounting_workflow.getScriptValueByReference(script.getReference())(state_change)
...@@ -7,4 +7,5 @@ if old_state.getId() == 'draft': ...@@ -7,4 +7,5 @@ if old_state.getId() == 'draft':
if internal_invoice.InternalInvoiceTransaction_getAuthenticatedUserSection() == internal_invoice.getDestinationSection(): if internal_invoice.InternalInvoiceTransaction_getAuthenticatedUserSection() == internal_invoice.getDestinationSection():
raise ValidationFailed(translateString("Your entity should not be destination.")) raise ValidationFailed(translateString("Your entity should not be destination."))
return state_change.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](state_change) script = state_change.getPortal().portal_workflow.accounting_workflow.getScriptValueByReference(script.getReference())
return script(state_change)
...@@ -31,7 +31,7 @@ for skin_folder in portal.portal_skins.objectValues('Folder'): ...@@ -31,7 +31,7 @@ for skin_folder in portal.portal_skins.objectValues('Folder'):
if include_workflow_scripts: if include_workflow_scripts:
for workflow in portal.portal_workflow.objectValues(): for workflow in portal.portal_workflow.objectValues():
for skin in workflow.scripts.objectValues(): for skin in workflow.getScriptValueList():
print getSkinHash(skin, workflow) print getSkinHash(skin, workflow)
container.REQUEST.RESPONSE.setHeader('content-type', 'text/plain') container.REQUEST.RESPONSE.setHeader('content-type', 'text/plain')
......
...@@ -10,9 +10,9 @@ portal = context.getPortalObject() ...@@ -10,9 +10,9 @@ portal = context.getPortalObject()
query_dict = {} query_dict = {}
workflow = portal.portal_workflow.ticket_workflow workflow = portal.portal_workflow.ticket_workflow
workflow_state_var = workflow.variables.getStateVar() workflow_state_var = workflow.getStateVariable()
for worklist in workflow.worklists.objectValues(): for worklist in workflow.getWorklistValueList():
identity_criterion_dict = worklist.getIdentityCriterionDict() identity_criterion_dict = worklist.getIdentityCriterionDict()
if portal_type \ if portal_type \
and 'portal_type' in worklist.getCriterionPropertyList() \ and 'portal_type' in worklist.getCriterionPropertyList() \
......
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