From bd6c671c538eac561071081db6c5f9d3c557db11 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 3 Nov 2005 15:44:44 +0000
Subject: [PATCH] if there is no mapped value, we have to take the default base
 price defined on the resource, it was not working

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4225 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Resource.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/product/ERP5/Document/Resource.py b/product/ERP5/Document/Resource.py
index 266bf1ffcc..a6425adabb 100755
--- a/product/ERP5/Document/Resource.py
+++ b/product/ERP5/Document/Resource.py
@@ -523,12 +523,13 @@ class Resource(XMLMatrix, CoreResource, Variated):
                                              has_cell_content=0, **kw)
       # Calculate the unit price
       unit_base_price = None
+      base_price = None
       if mapped_value is not None:
         base_price = mapped_value.getBasePrice()
-        if base_price in [None, '']:
-          base_price = self.getBasePrice()
-        if base_price not in [None, '']:
-          priced_quantity = self.getPricedQuantity()
-          unit_base_price = base_price / priced_quantity
+      if base_price in [None, '']:
+        base_price = self.getBasePrice()
+      if base_price not in [None, '']:
+        priced_quantity = self.getPricedQuantity()
+        unit_base_price = base_price / priced_quantity
       # Return result
       return unit_base_price
-- 
2.30.9