Commit f64ccf9a authored by Jérome Perrin's avatar Jérome Perrin

Supports using this movement group on movements that comes from invoice rule....

Supports using this movement group on movements that comes from invoice rule. In that case we cannot use same assumption to go up in simulation tree and find a delivery

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28937 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4fcad69f
......@@ -39,6 +39,11 @@ class DeliveryCausalityAssignmentMovementGroup(CausalityAssignmentMovementGroup)
def _addCausalityToEdit(self, movement, property_dict=None):
if property_dict is None:
property_dict = {}
if movement.getParentValue().isRootAppliedRule():
# Here movement probably comes from invoice rule, in that situation, we
# are not able to go up and find a delivery.
return property_dict
parent = movement.getParentValue().getParentValue()
# Go upper into the simulation tree in order to find a delivery link
while parent.getDeliveryValue() is None and not(parent.isRootAppliedRule()):
......
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