[Erp5-report] r32984 kazuhiko - /erp5/trunk/products/ERP5/Document/Rule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 23 06:12:25 CET 2010
Author: kazuhiko
Date: Tue Feb 23 06:12:24 2010
New Revision: 32984
URL: http://svn.erp5.org?rev=32984&view=rev
Log:
code cleanup.
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=32984&r1=32983&r2=32984&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Rule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Rule.py [utf8] Tue Feb 23 06:12:24 2010
@@ -34,7 +34,6 @@
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.Document.Predicate import Predicate
from Acquisition import aq_base
-from zLOG import LOG, WARNING
class Rule(Predicate, XMLObject):
"""
@@ -71,7 +70,7 @@
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
-
+
zope.interface.implements( interfaces.IPredicate,
interfaces.IRule )
@@ -86,7 +85,7 @@
, PropertySheet.Version
, PropertySheet.Rule
)
-
+
# Portal Type of created children
movement_type = 'Simulation Movement'
@@ -94,7 +93,7 @@
'isAccountable')
def isAccountable(self, movement):
"""Tells wether generated movement needs to be accounted or not.
-
+
Only account movements which are not associated to a delivery;
Whenever delivery is there, delivery has priority
"""
@@ -102,7 +101,7 @@
security.declareProtected(Permissions.ModifyPortalContent,
'constructNewAppliedRule')
- def constructNewAppliedRule(self, context, id=None,
+ def constructNewAppliedRule(self, context, id=None,
activate_kw=None, **kw):
"""
Creates a new applied rule which points to self
@@ -201,12 +200,12 @@
delivery = sim_mvt.getDeliveryValue()
if delivery is None:
return 0
-
+
if self.getDivergenceList(sim_mvt) == []:
return 0
else:
return 1
-
+
security.declareProtected(Permissions.View, 'getDivergenceList')
def getDivergenceList(self, sim_mvt):
"""
@@ -288,12 +287,12 @@
a movement is deletable if it has no delivered child, is not in current
state, and not in delivery movements.
- a movement
+ a movement
"""
immutable_movement_list = []
mutable_movement_list = []
deletable_movement_list = []
-
+
for movement in applied_rule.contentValues(portal_type=self.movement_type):
if movement.isFrozen():
immutable_movement_list.append(movement)
@@ -317,14 +316,11 @@
return [(input_movement, None) for input_movement in input_movement_list]
input_movement_and_path_list = []
- business_path_list = []
for input_movement in input_movement_list:
for business_path in business_process.getPathValueList(
trade_phase_list,
input_movement):
input_movement_and_path_list.append((input_movement, business_path))
- business_path not in business_path_list and business_path_list \
- .append(business_path)
return input_movement_and_path_list
@@ -444,7 +440,7 @@
**kw)
movement_list = immutable_movement_list + mutable_movement_list \
+ deletable_movement_list
- non_matched_list = movement_list[:] # list of remaining movements
+ non_matched_list = movement_list[:] # list of remaining movements
if matching_property_list is None:
matching_property_list = self.getMatchingPropertyList()
@@ -463,7 +459,7 @@
p_matched_list.append(movement)
# XXX hardcoded ...
-# LOG("Rule, _getCompensatedMovementList", WARNING,
+# LOG("Rule, _getCompensatedMovementList", WARNING,
# "Hardcoded properties check")
# Movements exist, we'll try to make them match the prevision
if p_matched_list != []:
More information about the Erp5-report
mailing list