Commit 5060228a authored by Papa Tamsir Kane's avatar Papa Tamsir Kane

erp5_decision: Remove unnecessary comments

parent eda07473
"""
This script is called by builder after a Decision is generated by simulation.
"""
'''
class MyException(Exception):
pass
raise MyException('ptk: got here!')
'''
portal = context.getPortalObject()
isTransitionPossible = portal.portal_workflow.isTransitionPossible
decision = context
......@@ -17,14 +12,6 @@ if isTransitionPossible(decision, 'post'):
# set some meaningful title
action_type = 'Approval'
'''
trade_phase = decision.getTradePhase()
if trade_phase=='contract/approve/initiator':
# initial phase is called Validation
action_type = 'Validation'
elif trade_phase=='contract/approve/legal':
action_type = 'Approval'
'''
title = '%s by %s' %(action_type, source_decision_value.getTitle())
decision.setTitle(title)
......
"""
List persons per division.
"""
from AccessControl import getSecurityManager
source_value = context.getSourceDecisionValue()
......@@ -10,10 +9,8 @@ source_type = source_value.getPortalType()
if source_type == 'Organisation':
organisation = source_value
elif source_type == 'Person':
#raise MyException('source type:' + source_type)
organisation = source_value.getCareerSubordinationValue()
else:
#position
organisation = source_value.getSubordinationValue()
person_list = []
......
......@@ -8,7 +8,7 @@ def getPreferenceForUser(owner_id):
Return Preference object for user
"""
preference_list = context.portal_preferences.searchFolder(
portal_type = 'Preference',
portal_type = 'Preference',
owner = owner_id)
preference_list = [x for x in preference_list if x.getProperty('preference_state', 'broken') in ('enabled', 'global')]
if len(preference_list):
......@@ -43,5 +43,5 @@ if source_decision_value is not None:
for reference in [x.getReference() for x in person_list]:
context.portal_notifications.sendMessage(
recipient=reference,
subject=subject,
subject=subject,
message=message)
......@@ -4,20 +4,12 @@
We need proxy roles as not always current approver has enough rights to change related Documents.
"""
portal = context.getPortalObject()
isTransitionPossible = portal.portal_workflow.isTransitionPossible
translate = portal.Base_translateString
decision = context
approval = decision.getApproval()
causality_value = decision.getCausalityValue()
'''
class MyException(Exception):
pass
raise MyException(str(causality_value))
'''
if causality_value.getPortalType() in ['Curation Request Line', 'Curation Request']:
if approval:
......@@ -30,18 +22,3 @@ if causality_value.getPortalType() in ['Curation Request Line', 'Curation Reques
portal.portal_workflow.doActionFor(causality_value,
'invalidate_action',
comment = translate('validation refused'), **kw)
'''
if not approval:
# cancel all other pending decisions if one is refused
other_decision_list = [x for x in causality_value.CurationRequest_getDecisionList() \
if x.getSimulationState()!='decided' and x!=decision]
for other_decision in other_decision_list:
if isTransitionPossible(other_decision, 'cancel_action'):
portal.portal_workflow.doActionFor(other_decision,
'cancel_action',
comment = translate('Canceled due to other decision rejection.'), **kw)
# invalidate the curation request
portal.portal_workflow.doActionFor(causality_value,
'invalidate_action',
comment = translate('Invalidated due to a decision rejection'), **kw)
'''
......@@ -11,6 +11,3 @@ for decision_line in decision.contentValues(filter = {'portal_type': 'Decision L
decision_line.decide()
#context.activate().Base_notifyDecisionStateChange(decision.getCausalityUid(), decision.getUid())
# update related document for decision
# decision.Decision_updateRelatedDocument()
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