[Erp5-report] r21025 - in /erp5/trunk/products/ERP5: DeliverySolver/ TargetSolver/
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue May 20 10:36:42 CEST 2008
Author: kazuhiko
Date: Tue May 20 10:36:41 2008
New Revision: 21025
URL: http://svn.erp5.org?rev=21025&view=rev
Log:
code cleanup.
Modified:
erp5/trunk/products/ERP5/DeliverySolver/Distribute.py
erp5/trunk/products/ERP5/TargetSolver/ProfitAndLoss.py
Modified: erp5/trunk/products/ERP5/DeliverySolver/Distribute.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/DeliverySolver/Distribute.py?rev=21025&r1=21024&r2=21025&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/DeliverySolver/Distribute.py (original)
+++ erp5/trunk/products/ERP5/DeliverySolver/Distribute.py Tue May 20 10:36:41 2008
@@ -1,13 +1,13 @@
##############################################################################
#
-# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
+# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp at nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
+# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
+# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
@@ -27,9 +27,7 @@
##############################################################################
-#from Products.ERP5.Tool.SimulationTool import registerDeliverySolver
from DeliverySolver import DeliverySolver
-from zLOG import LOG
class Distribute(DeliverySolver):
"""
@@ -51,19 +49,12 @@
for simulation_movement in simulation_movement_list:
quantity = simulation_movement.getCorrectedQuantity()
simulation_quantity += quantity
-
+
if simulation_quantity != 0:
for simulation_movement in simulation_movement_list:
- #simulation_movement.setDeliveryRatio(simulation_movement.getCorrectedQuantity() / simulation_quantity)
- simulation_movement.edit(delivery_ratio = simulation_movement.getCorrectedQuantity() / simulation_quantity)
- #simulation_movement.immediateReindexObject()
+ simulation_movement.edit(delivery_ratio=simulation_movement.getCorrectedQuantity() / simulation_quantity)
else:
if len(simulation_movement_list) > 0:
delivery_ratio = 1./len(simulation_movement_list)
for simulation_movement in simulation_movement_list:
- #simulation_movement.setDeliveryRatio(delivery_ratio)
- simulation_movement.edit(delivery_ratio = delivery_ratio)
-
- #movement.activate(after_path_and_method_id=([m.getPath() for m in simulation_movement_list], ['immediateReindexObject', 'recursiveImmediateReindexObject'])).edit()
-
-#registerDeliverySolver(Distribute)
+ simulation_movement.edit(delivery_ratio=delivery_ratio)
Modified: erp5/trunk/products/ERP5/TargetSolver/ProfitAndLoss.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/TargetSolver/ProfitAndLoss.py?rev=21025&r1=21024&r2=21025&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/TargetSolver/ProfitAndLoss.py (original)
+++ erp5/trunk/products/ERP5/TargetSolver/ProfitAndLoss.py Tue May 20 10:36:41 2008
@@ -1,13 +1,13 @@
##############################################################################
#
-# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
+# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp at nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
+# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
+# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
@@ -27,7 +27,6 @@
##############################################################################
-# from Products.ERP5.Tool.SimulationTool import registerTargetSolver
from CopyToTarget import CopyToTarget
class ProfitAndLoss(CopyToTarget):
@@ -49,12 +48,10 @@
if delivery_line_quantity is not None:
target_quantity = delivery_line_quantity * movement.getDeliveryRatio()
added_quantity = movement.getQuantity() - target_quantity
- movement.edit(profit_quantity = added_quantity)
- delivery = movement.getDeliveryValue()
- if delivery is not None:
- delivery.activate(
- after_path_and_method_id = (
- movement.getPath(),
- ['immediateReindexObject', 'recursiveImmediateReindexObject']
- )
- ).edit()
+ movement.edit(profit_quantity=added_quantity)
+ delivery_line.activate(
+ after_path_and_method_id=(
+ movement.getPath(),
+ ['immediateReindexObject', 'recursiveImmediateReindexObject']
+ )
+ ).edit()
More information about the Erp5-report
mailing list