Commit 67b915dd authored by Sebastien Robin's avatar Sebastien Robin

added again a movement group

git-svn-id: 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3cadc6e
......@@ -327,6 +327,31 @@ class RootAppliedRuleCausalityMovementGroup(RootMovementGroup):
# Again add a strange movement group, it was first created for building
# Sale invoices transactions lines. We need to put accounting lines
# in the same invoices than invoice lines.
class ParentExplanationMovementGroup(RootMovementGroup):
""" Groups movement that comes from simulation movement that shares the
same explanation relation. For example, it groups in an Invoice
movements from the same Packing List. """
def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw)
explanation_value = self._getParentExplanationValue(movement)
self.explanation_value = explanation_value
parent_explanation_value = explanation_value
def _getParentExplanationValue(self, movement):
""" Get the order value for a movement """
return movement.getParentValue().getExplanationValue()
def test(self,movement):
return self._getParentExplanationValue(movement) == self.explanation_value
class PathMovementGroup(RootMovementGroup):
""" Group movements that have the same source and the same destination."""
def __init__(self, movement, **kw):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment