Commit cd967cac authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

workflow: now another workflow script should be accessed by...

workflow: now another workflow script should be accessed by container.script_<SCRIPT_ID>, instead of container.<SCRIPT_ID>.
parent 6997f8c1
......@@ -2,4 +2,4 @@
because only validated accounts are displayed in the cache.
"""
if sci['object'].getValidationState() == 'validated':
container.Account_flushAccountListCache(sci)
container.script_Account_flushAccountListCache(sci)
......@@ -13,7 +13,7 @@ section_portal_type_list = ['Person', 'Organisation']
invalid_state_list = ['invalidated', 'deleted']
# first of all, validate the transaction itself
container.validateTransaction(state_change)
container.script_validateTransaction(state_change)
# 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[script.getId()](sci)
state_change['object'].AccountingTransaction_setDefaultMirrorAccountList()
return container.setReferences(state_change)
return container.script_setReferences(state_change)
return sci.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](sci)
return sci.getPortal().portal_workflow.accounting_workflow[script.getId()](sci)
return state_change.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](state_change)
return state_change.getPortal().portal_workflow.accounting_workflow[script.getId()](state_change)
return state_change.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](state_change)
return state_change.getPortal().portal_workflow.accounting_workflow[script.getId()](state_change)
......@@ -7,4 +7,4 @@ if old_state.getId() == 'draft':
if internal_invoice.InternalInvoiceTransaction_getAuthenticatedUserSection() == internal_invoice.getDestinationSection():
raise ValidationFailed(translateString("Your entity should not be destination."))
return state_change.getPortal().portal_workflow.accounting_workflow.scripts[script.getId()](state_change)
return state_change.getPortal().portal_workflow.accounting_workflow[script.getId()](state_change)
......@@ -24,4 +24,4 @@ for simulation_movement in simulation_movement_list:
if simulation_movement.getOrder() == delivery_movement.getRelativeUrl():
simulation_movement.setOrder(None)
context.DeliveryMovement_updateSimulation(state_change)
container.script_DeliveryMovement_updateSimulation(state_change)
from Products.ERP5Type.Core.Workflow import ValidationFailed
from Products.ERP5Type.Message import translateString
container.Event_checkConsistency(sci)
container.script_Event_checkConsistency(sci)
portal = sci.getPortal()
portal_workflow = portal.portal_workflow
......
......@@ -15,4 +15,4 @@ if test_result.getPortalType() == 'Test Result Node':
edit_kw[key] = key_value
test_result.edit(**edit_kw)
else:
context.TestResult_complete(sci)
container.script_TestResult_complete(sci)
......@@ -3,14 +3,14 @@ portal = context.getPortalObject()
portal_type = ticket.getPortalType()
if portal_type in ("Leave Request", "Leave Request Period"):
context.Alarm_safeTrigger(
container.script_Alarm_safeTrigger(
portal.portal_alarms.create_representative_record_for_leave_request
)
elif portal_type in ("Expense Validation Request"):
context.Alarm_safeTrigger(
container.script_Alarm_safeTrigger(
portal.portal_alarms.create_representative_record_for_expense_validation_request
)
elif portal_type in ("Travel Request"):
context.Alarm_safeTrigger(
container.script_Alarm_safeTrigger(
portal.portal_alarms.create_representative_record_for_travel_request
)
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