diff --git a/product/ERP5/Document/BPMDeliveryRule.py b/product/ERP5/Document/BPMDeliveryRule.py index 24bee15dfe0b1e60b6908b9d8e373679c58e5308..88f5820d28afbe5c72a3e9377b99e241a9ee7763 100644 --- a/product/ERP5/Document/BPMDeliveryRule.py +++ b/product/ERP5/Document/BPMDeliveryRule.py @@ -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, diff --git a/product/ERP5/Document/BPMInvoiceTransactionRule.py b/product/ERP5/Document/BPMInvoiceTransactionRule.py index 6cdbf8ac6e16f34536f8416b9b2d4c03cbaac293..5de731902204509483bcec9416a0cca79099d6dc 100644 --- a/product/ERP5/Document/BPMInvoiceTransactionRule.py +++ b/product/ERP5/Document/BPMInvoiceTransactionRule.py @@ -46,7 +46,7 @@ class BPMInvoiceTransactionRule(BPMRule, PredicateMatrix): add_permission = Permissions.AddPortalContent isPortalContent = 1 isRADContent = 1 - + # Declarative security security = ClassSecurityInfo() security.declareObjectProtected(Permissions.AccessContentsInformation) diff --git a/product/ERP5/Document/BPMInvoicingRule.py b/product/ERP5/Document/BPMInvoicingRule.py index 74f9c7617441bd76a0dd8d1223e66ae417800e49..60082970e45e1c333026a4a3c0bdfc7c091f6986 100644 --- a/product/ERP5/Document/BPMInvoicingRule.py +++ b/product/ERP5/Document/BPMInvoicingRule.py @@ -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 diff --git a/product/ERP5/Document/BPMOrderRule.py b/product/ERP5/Document/BPMOrderRule.py index 0597f46ec6af6220e76c2deea6e662634e6d4b4b..644a86694197a1ac1216eb487160c9f659972b06 100644 --- a/product/ERP5/Document/BPMOrderRule.py +++ b/product/ERP5/Document/BPMOrderRule.py @@ -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, diff --git a/product/ERP5/Document/BPMRule.py b/product/ERP5/Document/BPMRule.py index 086d7ca353c5a74237ded4186e46f1082a3e4194..4b75fe57d911f5139edce0a5774d48c815462c02 100644 --- a/product/ERP5/Document/BPMRule.py +++ b/product/ERP5/Document/BPMRule.py @@ -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 = {}