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): ...@@ -49,15 +49,16 @@ class BPMDeliveryRule(BPMRule):
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
def _getInputMovementList(self, applied_rule): def _getInputMovementList(self, applied_rule):
"""Returns list of input movements for applied rule""" """Return list of movements from delivery"""
order = applied_rule.getDefaultCausalityValue() delivery = applied_rule.getDefaultCausalityValue()
if order is not None: if delivery is not None:
return order.getMovementList( return delivery.getMovementList(
portal_type=order.getPortalDeliveryMovementTypeList()) portal_type=delivery.getPortalDeliveryMovementTypeList())
return [] return []
def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path, def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path,
**kw): **kw):
"""Delivery specific update dict"""
return { return {
'order_value': movement, 'order_value': movement,
'delivery_value': movement, 'delivery_value': movement,
......
...@@ -67,9 +67,5 @@ class BPMInvoicingRule(BPMRule): ...@@ -67,9 +67,5 @@ class BPMInvoicingRule(BPMRule):
'deliverable': 1 'deliverable': 1
} }
def _getInputMovementList(self, applied_rule):
"""Returns list of input movements for applied rule"""
return [applied_rule.getParentValue()]
def isDeliverable(self, movement): def isDeliverable(self, movement):
return movement.getResource() is not None return movement.getResource() is not None
...@@ -48,7 +48,7 @@ class BPMOrderRule(BPMDeliveryRule): ...@@ -48,7 +48,7 @@ class BPMOrderRule(BPMDeliveryRule):
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
def _getInputMovementList(self, applied_rule): def _getInputMovementList(self, applied_rule):
"""Returns list of input movements for applied rule""" """Input movement list comes from order"""
order = applied_rule.getDefaultCausalityValue() order = applied_rule.getDefaultCausalityValue()
if order is not None: if order is not None:
return order.getMovementList( return order.getMovementList(
...@@ -57,6 +57,7 @@ class BPMOrderRule(BPMDeliveryRule): ...@@ -57,6 +57,7 @@ class BPMOrderRule(BPMDeliveryRule):
def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path, def _getExpandablePropertyUpdateDict(self, applied_rule, movement, business_path,
**kw): **kw):
"""Order rule specific update dictionary"""
return { return {
'order_value': movement, 'order_value': movement,
'order_ratio': 1, 'order_ratio': 1,
......
...@@ -199,12 +199,22 @@ class BPMRule(Rule): ...@@ -199,12 +199,22 @@ class BPMRule(Rule):
movement.getRelativeUrl()) movement.getRelativeUrl())
return (add_list, modify_dict, delete_list) 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, def _getExpandablePropertyDict(self, applied_rule, movement, business_path,
**kw): **kw):
""" """
Return a Dictionary with the Properties used to edit Return a Dictionary with the Properties used to edit the simulation
the simulation movement. A supply path can be passed to assign more Do NOT overload this method, use _getExpandablePropertyUpdateDict instead
information
""" """
property_dict = {} 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