How to improve Movement Groups.
Table of Contents
Current Limits¶
Those limits were solved. There are kept only for reference.
It is currently very hard to customize movement groups. If we want to setup a new movement group, we have to modify ERP5/MovementGroup.py. As we can see, there is more and more MovementGroups, and for
each customer we might need again more.
We might think about predicates, it would be great to customize a movement group with a script.
Design problem¶
There is also a design problem between movement groups and builders.
The main problem is that the test method of each MovementGroup is only used when we want to group movement, but it is not used when we want to see if we want to update an existing movement.
This is a bit difficult to understand, so I will explain with an example : OrderMovementGroup.
The test method look at the causality value of the root applied rule of a movement. But when the delivery builder wants to know if we can update an existing delivery, it uses a dictionnary that comes
from getGroupEditDict() available on each movement group.
For the OrderMovementGroup, getGroupEditDict() returns :
property_dict = {'causality_value':}
Then in the delivery builder the method testObjectProperties is called with the delivery as parameter and also the property_dict.
So, like this, if the causality value is not set on the delivery, then the delivery will never be updated, even if all movements of this delivery comes from the right order.
We should find another way, it is not good to store values on delivery/line/cell for each movement groups. The group_edit_dict should only be used to setup nicely new objets created by the builder,
but it should not be used in order to implement test function.
I guess the testObjetProperties of the delivery builder should be removed, and we might find another way.
A solution could be: - run collectMovement with simulation movements as it is already done. - run collectMovement with all movements that comes from deliveries we want to update. - and then it might
be possible to compare both trees (more thinking is required).
Related Articles¶