[Erp5-report] r32538 kazuhiko - in /erp5/trunk/products/ERP5/Document: BusinessPath.py Rule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Feb 15 10:36:32 CET 2010
Author: kazuhiko
Date: Mon Feb 15 10:36:31 2010
New Revision: 32538
URL: http://svn.erp5.org?rev=32538&view=rev
Log:
initial implementation of getExpectedQuantity().
Modified:
erp5/trunk/products/ERP5/Document/BusinessPath.py
erp5/trunk/products/ERP5/Document/Rule.py
Modified: erp5/trunk/products/ERP5/Document/BusinessPath.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessPath.py?rev=32538&r1=32537&r2=32538&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] Mon Feb 15 10:36:31 2010
@@ -406,6 +406,20 @@
and self._isDeliverySimulationMovementRelated(
explanation, simulation_movement)]
+ def getExpectedQuantity(self, explanation, *args, **kwargs):
+ """
+ Returns the expected stop date for this
+ path based on the explanation.
+
+ XXX predecessor_quantity argument is required?
+ """
+ if self.getQuantity():
+ return self.getQuantity()
+ elif self.getEfficiency():
+ return explanation.getQuantity() * self.getEfficiency()
+ else:
+ return explanation.getQuantity()
+
def getExpectedStartDate(self, explanation, predecessor_date=None, *args, **kwargs):
"""
Returns the expected start date for this
Modified: erp5/trunk/products/ERP5/Document/Rule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Rule.py?rev=32538&r1=32537&r2=32538&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Rule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Rule.py [utf8] Mon Feb 15 10:36:31 2010
@@ -588,15 +588,11 @@
property_dict['%s_list' % base_category] = [category_url]
else:
property_dict['%s_list' % base_category] = []
+
# Amount
- if business_path.getQuantity():
- property_dict['quantity'] = business_path.getQuantity()
- elif business_path.getEfficiency():
- property_dict['quantity'] = movement.getQuantity() *\
- business_path.getEfficiency()
- else:
- property_dict['quantity'] = movement.getQuantity()
-
+ property_dict['quantity'] = business_path.getExpectedQuantity()
+
+ # Date
if movement.getStartDate() == movement.getStopDate():
property_dict['start_date'] = business_path.getExpectedStartDate(
movement)
More information about the Erp5-report
mailing list