[Erp5-report] r32455 kazuhiko - /erp5/trunk/products/ERP5/Document/Rule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Feb 12 03:11:43 CET 2010
Author: kazuhiko
Date: Fri Feb 12 03:11:42 2010
New Revision: 32455
URL: http://svn.erp5.org?rev=32455&view=rev
Log:
it is better to specify matching property list in rule document, instead of rule class.
Modified:
erp5/trunk/products/ERP5/Document/Rule.py
Modified: erp5/trunk/products/ERP5/Document/Rule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Rule.py?rev=32455&r1=32454&r2=32455&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Rule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Rule.py [utf8] Fri Feb 12 03:11:42 2010
@@ -426,10 +426,7 @@
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 @@
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
@@ -452,6 +448,13 @@
movement_list = immutable_movement_list + mutable_movement_list \
+ 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 = []
More information about the Erp5-report
mailing list