diff --git a/product/ERP5/Document/Rule.py b/product/ERP5/Document/Rule.py index 60887346899efaa8d050bd5be4bc1600ad5fc40d..a847b1a95339d0cf492b28aee74e3e92bfc63443 100644 --- a/product/ERP5/Document/Rule.py +++ b/product/ERP5/Document/Rule.py @@ -426,10 +426,7 @@ class Rule(Predicate, XMLObject): return (add_list, modify_dict, delete_list) def _getCompensatedMovementList(self, applied_rule, - matching_property_list=( - 'resource', - 'variation_category_list', - 'variation_property_dict',), **kw): + matching_property_list=None, **kw): """ Compute the difference between prevision and existing movements @@ -439,8 +436,7 @@ class Rule(Predicate, XMLObject): using MovementGroups """ if self._isBPM(): - return self._getCompensatedMovementListBPM(applied_rule, - matching_property_list=matching_property_list, **kw) + return self._getCompensatedMovementListBPM(applied_rule, **kw) add_list = [] # list of movements to be added modify_dict = {} # dict of movements to be modified delete_list = [] # list of movements to be deleted @@ -453,6 +449,13 @@ class Rule(Predicate, XMLObject): + deletable_movement_list non_matched_list = movement_list[:] # list of remaining movements + if matching_property_list is None: + matching_property_list = self.getMatchingPropertyList() + if len(matching_property_list) == 0: + matching_property_list = ('resource', + 'variation_category_list', + 'variation_property_dict',) + for prevision in prevision_list: p_matched_list = [] for movement in non_matched_list: