[Erp5-report] r34760 tatuya - /erp5/trunk/products/ERP5Legacy/Document/TradeModelRule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Apr 25 16:22:24 CEST 2010
Author: tatuya
Date: Sun Apr 25 16:22:24 2010
New Revision: 34760
URL: http://svn.erp5.org?rev=34760&view=rev
Log:
Now Rule enable to expand no Business Path even if using BPM. Because Business Path is a predicate and no business path case exisits as the context.
Modified:
erp5/trunk/products/ERP5Legacy/Document/TradeModelRule.py
Modified: erp5/trunk/products/ERP5Legacy/Document/TradeModelRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Legacy/Document/TradeModelRule.py?rev=34760&r1=34759&r2=34760&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Legacy/Document/TradeModelRule.py [utf8] (original)
+++ erp5/trunk/products/ERP5Legacy/Document/TradeModelRule.py [utf8] Sun Apr 25 16:22:24 2010
@@ -62,14 +62,13 @@
# business path specific
business_path_list = business_process.getPathValueList(
trade_phase=amount.getTradePhaseList(), context=context_movement)
- if len(business_path_list) == 0:
- raise ValueError('Cannot find Business Path')
-
- if len(business_path_list) != 1:
+ if len(business_path_list) > 1:
raise NotImplementedError('Only one Business Path is supported')
- business_path = business_path_list[0]
-
+ if business_path_list:
+ business_path = business_path_list[0]
+ else:
+ business_path = None
movement_kw = self._getExpandablePropertyDict(applied_rule,
context_movement, business_path)
More information about the Erp5-report
mailing list