Commit c1208103 authored by Łukasz Nowak's avatar Łukasz Nowak

- update docstrings and small fixes

 - put more into base class
 - inform developer what is to overload and what is to not


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28152 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f8a1d351
......@@ -49,15 +49,16 @@ class BPMDeliveryRule(BPMRule):
security.declareObjectProtected(Permissions.AccessContentsInformation)
def _getInputMovementList(self, applied_rule):
"""Returns list of input movements for applied rule"""
order = applied_rule.getDefaultCausalityValue()
if order is not None:
return order.getMovementList(
portal_type=order.getPortalDeliveryMovementTypeList())
"""Return list of movements from delivery"""
delivery = applied_rule.getDefaultCausalityValue()
if delivery is not None:
return delivery.getMovementList(
portal_type=delivery.getPortalDeliveryMovementTypeList())
return []
def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path,
**kw):
"""Delivery specific update dict"""
return {
'order_value': movement,
'delivery_value': movement,
......
......@@ -46,7 +46,7 @@ class BPMInvoiceTransactionRule(BPMRule, PredicateMatrix):
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
......
......@@ -67,9 +67,5 @@ class BPMInvoicingRule(BPMRule):
'deliverable': 1
}
def _getInputMovementList(self, applied_rule):
"""Returns list of input movements for applied rule"""
return [applied_rule.getParentValue()]
def isDeliverable(self, movement):
return movement.getResource() is not None
......@@ -48,7 +48,7 @@ class BPMOrderRule(BPMDeliveryRule):
security.declareObjectProtected(Permissions.AccessContentsInformation)
def _getInputMovementList(self, applied_rule):
"""Returns list of input movements for applied rule"""
"""Input movement list comes from order"""
order = applied_rule.getDefaultCausalityValue()
if order is not None:
return order.getMovementList(
......@@ -57,6 +57,7 @@ class BPMOrderRule(BPMDeliveryRule):
def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path,
**kw):
"""Order rule specific update dictionary"""
return {
'order_value': movement,
'order_ratio': 1,
......
......@@ -199,12 +199,22 @@ class BPMRule(Rule):
movement.getRelativeUrl())
return (add_list, modify_dict, delete_list)
def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path, **kw):
"""Rule specific dictionary used to update _getExpandablePropertyDict
This method might be overloaded.
"""
return {}
def _getInputMovementList(self, applied_rule):
"""Return list of movements for applied rule.
This method might be overloaded"""
return [applied_rule.getParentValue()]
def _getExpandablePropertyDict(self, applied_rule, movement, business_path,
**kw):
"""
Return a Dictionary with the Properties used to edit
the simulation movement. A supply path can be passed to assign more
information
Return a Dictionary with the Properties used to edit the simulation
Do NOT overload this method, use _getExpandablePropertyUpdateDict instead
"""
property_dict = {}
......
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