[Erp5-report] r15861 - in /erp5/trunk/products/ERP5: Document/ PropertySheet/
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Aug 28 10:45:41 CEST 2007
Author: seb
Date: Tue Aug 28 10:45:41 2007
New Revision: 15861
URL: http://svn.erp5.org?rev=15861&view=rev
Log:
added cancellation amount property and use it for getSource/Destination Credit/Debit
Modified:
erp5/trunk/products/ERP5/Document/Movement.py
erp5/trunk/products/ERP5/PropertySheet/Amount.py
Modified: erp5/trunk/products/ERP5/Document/Movement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Movement.py?rev=15861&r1=15860&r2=15861&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Movement.py (original)
+++ erp5/trunk/products/ERP5/Document/Movement.py Tue Aug 28 10:45:41 2007
@@ -734,7 +734,9 @@
quantity = float(quantity)
except TypeError:
quantity = 0.0
- if quantity < 0:
+ if (quantity < 0 and not self.isCancellationAmount()):
+ return - quantity
+ elif quantity > 0 and self.isCancellationAmount():
return - quantity
else:
return 0.0
@@ -750,7 +752,8 @@
quantity = float(quantity)
except TypeError:
quantity = 0.0
- if quantity < 0:
+ if quantity < 0 and not self.isCancellationAmount() \
+ or quantity > 0 and self.isCancellationAmount():
return 0.0
else:
return quantity
Modified: erp5/trunk/products/ERP5/PropertySheet/Amount.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/PropertySheet/Amount.py?rev=15861&r1=15860&r2=15861&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/PropertySheet/Amount.py (original)
+++ erp5/trunk/products/ERP5/PropertySheet/Amount.py Tue Aug 28 10:45:41 2007
@@ -91,6 +91,10 @@
'acquisition_accessor_id' : 'getQuantity',
'acquisition_depends' : None,
'mode' : 'w' },
+ { 'id' : 'cancellation_amount',
+ 'description' : 'defines if this quantity is used in order to cancel another one',
+ 'type' : 'boolean',
+ 'mode' : 'w' },
# quantity_sign is used by QuantitySignMovementGroup
# When comparing a delivery to a property_dict coming from a MovementGroup,
# the DeliveryBuilder needs to have at least a specific property for each MovementGroup
More information about the Erp5-report
mailing list