Commit 87581e79 authored by Romain Courteaud's avatar Romain Courteaud

Make expand more generic, in order to delete expand in InvoiceRule.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3720 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d838b301
......@@ -65,7 +65,8 @@ class DeliveryRule(Rule):
# Simulation workflow
security.declareProtected(Permissions.ModifyPortalContent, 'expand')
def expand(self, applied_rule, **kw):
def expand(self, applied_rule,
movement_type_method='getPortalOrderMovementTypeList', **kw):
"""
Expands the current movement downwards.
-> new status -> expanded
......@@ -88,8 +89,8 @@ class DeliveryRule(Rule):
existing_uid_list = []
existing_uid_list_append = existing_uid_list.append
movement_type_list = applied_rule.getPortalMovementTypeList()
order_movement_type_list = \
applied_rule.getPortalOrderMovementTypeList()
order_movement_type_list = getattr(applied_rule,
movement_type_method)()
for movement in applied_rule.contentValues(
filter={'portal_type':movement_type_list}):
......@@ -137,7 +138,7 @@ class DeliveryRule(Rule):
except AttributeError:
LOG('ERP5: WARNING', 0,
'AttributeError during expand on delivery line %s'\
% delivery_line_object.absolute_url())
% delivery_movement.absolute_url())
# Pass to base class
Rule.expand(self, applied_rule, **kw)
......
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