[Erp5-report] r35596 yo - /erp5/trunk/products/ERP5/Document/Amount.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 25 06:55:37 CEST 2010


Author: yo
Date: Tue May 25 06:55:35 2010
New Revision: 35596

URL: http://svn.erp5.org?rev=35596&view=rev
Log:
Make getBaseUnitPrice context-aware.

Modified:
    erp5/trunk/products/ERP5/Document/Amount.py

Modified: erp5/trunk/products/ERP5/Document/Amount.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Amount.py?rev=35596&r1=35595&r2=35596&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Amount.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Amount.py [utf8] Tue May 25 06:55:35 2010
@@ -426,7 +426,7 @@
       return
     tv[key] = 1
     try:
-      resource = self.getResourceValue()
+      resource = context.getResourceValue()
       if resource is not None:
         operand_dict = resource.getPriceParameterDict(context=context)
         if operand_dict is not None:
@@ -436,7 +436,7 @@
       del tv[key]
 
   security.declareProtected(Permissions.AccessContentsInformation, 'getBaseUnitPrice')
-  def getBaseUnitPrice(self, **kw):
+  def getBaseUnitPrice(self, context=None, **kw):
     """
       Get the base unit price.
 
@@ -445,7 +445,9 @@
     local_base_unit_price = self._baseGetBaseUnitPrice()
     if local_base_unit_price is None:
       # We must find a base unit price for this movement
-      local_base_unit_price = self._getBaseUnitPrice(context=self)
+      if context is None:
+        context = self
+      local_base_unit_price = self._getBaseUnitPrice(context=context)
     return local_base_unit_price
 
   security.declareProtected(Permissions.AccessContentsInformation, 




More information about the Erp5-report mailing list