From 0cf9302ebfba18a4eddb6d6aef1411ccf6e50d47 Mon Sep 17 00:00:00 2001
From: "olt@tinyerp.com" <>
Date: Fri, 1 Oct 2010 15:47:00 +0200
Subject: [PATCH] [IMP] mrp: 'cost structure' report now uses decimal_precicion
bzr revid: olt@tinyerp.com-20101001134700-me63ezim7vc8a3ok
---
addons/mrp/report/price.py | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py
index 3a6ab81a308..52bcf3bcd4a 100644
--- a/addons/mrp/report/price.py
+++ b/addons/mrp/report/price.py
@@ -131,6 +131,8 @@ class report_custom(report_rml):
""" % (_('Component'), _('Component suppliers'), _('Quantity'),_('Cost Price per Uom')+'('+company_currency.code+')', _('Supplier Price per Uom')+'('+company_currency.code+')')
+ purchase_price_digits = rml_obj.get_digits(dp='Purchase Price')
+
for product in product_pool.browse(cr, uid, ids, context=context):
bom_id = bom_pool._bom_find(cr, uid, product.id, product.uom_id.id)
title = "
%s" %(_("Cost Structure"))
@@ -150,8 +152,8 @@ class report_custom(report_rml):
""" + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+ """:
- """+ rml_obj.formatLang(total_strd) +' '+ company_currency.symbol + """
- """+ rml_obj.formatLang(total) +' '+ company_currency.symbol + """
+ """+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ company_currency.symbol + """
+ """+ rml_obj.formatLang(total, digits=purchase_price_digits) +' '+ company_currency.symbol + """
'"""
else:
bom = bom_pool.browse(cr, uid, bom_id, context=context)
@@ -177,8 +179,8 @@ class report_custom(report_rml):
""" + _('Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'(' + company_currency.code +')'+ """:
- """+ rml_obj.formatLang(total_strd) +' '+ company_currency.symbol + """
- """+ rml_obj.formatLang(total) +' '+ company_currency.symbol + """
+ """+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ company_currency.symbol + """
+ """+ rml_obj.formatLang(total, digits=purchase_price_digits) +' '+ company_currency.symbol + """
'"""
total2 = 0
@@ -195,14 +197,14 @@ class report_custom(report_rml):
- """+ rml_obj.formatLang(total2) +' '+ company_currency.symbol +"""
+ """+ rml_obj.formatLang(total2, digits=purchase_price_digits) +' '+ company_currency.symbol +"""
'"""
xml += """
""" + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+ """:
- """+ rml_obj.formatLang(total_strd+total2) +' '+ company_currency.symbol + """
- """+ rml_obj.formatLang(total+total2) +' '+ company_currency.symbol + """
+ """+ rml_obj.formatLang(total_strd+total2, digits=purchase_price_digits) +' '+ company_currency.symbol + """
+ """+ rml_obj.formatLang(total+total2, digits=purchase_price_digits) +' '+ company_currency.symbol + """
'"""
xml = '' + config_start + config_stop + xml + ''