[Erp5-report] r27242 - /erp5/trunk/products/ERP5/Document/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri May 29 13:47:36 CEST 2009
Author: jerome
Date: Fri May 29 13:47:35 2009
New Revision: 27242
URL: http://svn.erp5.org?rev=27242&view=rev
Log:
corrected quantity should take delivery error into account, otherwise we will
expand different quantites than the delivery line
Modified:
erp5/trunk/products/ERP5/Document/QuantityDivergenceTester.py
erp5/trunk/products/ERP5/Document/SimulationMovement.py
Modified: erp5/trunk/products/ERP5/Document/QuantityDivergenceTester.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/QuantityDivergenceTester.py?rev=27242&r1=27241&r2=27242&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/QuantityDivergenceTester.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/QuantityDivergenceTester.py [utf8] Fri May 29 13:47:35 2009
@@ -71,7 +71,6 @@
d_quantity = delivery.getQuantity()
quantity = simulation_movement.getCorrectedQuantity()
- d_error = simulation_movement.getDeliveryError()
extra_parameters = dict()
if abs(quantity - d_quantity) < 1:
@@ -98,8 +97,6 @@
return [message]
if d_quantity is None:
d_quantity = 0
- if d_error is None:
- d_error = 0
delivery_ratio = simulation_movement.getDeliveryRatio()
# if the delivery_ratio is None, make sure that we are
# divergent even if the delivery quantity is 0
@@ -110,7 +107,7 @@
if delivery_ratio == 0 and quantity > 0:
return [message]
- if not self.compare(d_quantity, quantity+d_error):
+ if not self.compare(d_quantity, quantity):
return [message]
return []
Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=27242&r1=27241&r2=27242&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] Fri May 29 13:47:35 2009
@@ -438,15 +438,13 @@
'getCorrectedQuantity')
def getCorrectedQuantity(self):
"""
- Returns the quantity property deducted by the possible profit_quantity
+ Returns the quantity property deducted by the possible profit_quantity and
+ taking into account delivery error
"""
quantity = self.getQuantity()
- profit_quantity = self.getProfitQuantity()
- if quantity is not None:
- if profit_quantity:
- return quantity - profit_quantity
- return quantity
- return None
+ profit_quantity = self.getProfitQuantity() or 0
+ delivery_error = self.getDeliveryError() or 0
+ return quantity - profit_quantity + delivery_error
security.declareProtected( Permissions.AccessContentsInformation,
'getRootSimulationMovement')
More information about the Erp5-report
mailing list