From 2d83c96317f0609a2fe04e211f54bb0cb6f42a7a Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Wed, 31 Aug 2011 18:30:50 +0530 Subject: [PATCH] [FIX]:Product cost structure report xml predefined entities problem lp bug: https://launchpad.net/bugs/834004 fixed bzr revid: ksa@tinyerp.com-20110831130050-uvonk98nbe437sd7 --- addons/mrp/report/price.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 733312ba799..e28250a2531 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -26,7 +26,7 @@ from tools import to_xml from report import report_sxw from datetime import datetime from tools.translate import _ - +import tools #FIXME: we should use toxml class report_custom(report_rml): @@ -48,14 +48,14 @@ class report_custom(report_rml): sum_strd = 0 prod = product_pool.browse(cr, uid, bom['product_id']) - prod_name = bom['name'] + prod_name = to_xml(tools.ustr(bom['name'])) prod_qtty = factor * bom['product_qty'] product_uom = product_uom_pool.browse(cr, uid, bom['product_uom'], context=context) main_sp_price, main_sp_name , main_strd_price = '','','' sellers, sellers_price = '','' if prod.seller_id: - main_sp_name = "%s\r\n" %(prod.seller_id.name) + main_sp_name = "%s\r\n" % to_xml(tools.ustr(prod.seller_id.name)) price = supplier_info_pool.price_get(cr, uid, prod.seller_id.id, prod.id, number*prod_qtty)[prod.seller_id.id] price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, price, to_uom_id=product_uom.id) main_sp_price = """"""+rml_obj.formatLang(price)+' '+ company_currency.symbol+"""\r\n""" @@ -64,12 +64,12 @@ class report_custom(report_rml): main_strd_price = str(std_price) + '\r\n' sum_strd = prod_qtty*std_price for seller_id in prod.seller_ids: - sellers += '- '+ seller_id.name.name +'\r\n' + sellers += '- '+ to_xml(tools.ustr(seller_id.name.name)) +'\r\n' price = supplier_info_pool.price_get(cr, uid, seller_id.name.id, prod.id, number*prod_qtty)[seller_id.name.id] price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, price, to_uom_id=product_uom.id) sellers_price += """"""+rml_obj.formatLang(price) +' '+ company_currency.symbol +"""\r\n""" - xml += """ """+ prod_name +""" - """+ main_sp_name + sellers + """ + xml += """ """+ to_xml(tools.ustr(prod_name)) +""" + """+ to_xml(tools.ustr(main_sp_name)) + to_xml(tools.ustr(sellers)) + """ """+ rml_obj.formatLang(prod_qtty) +' '+ product_uom.name +""" """+ rml_obj.formatLang(float(main_strd_price)) +' '+ company_currency.symbol +""" """ + main_sp_price + sellers_price + """'""" @@ -134,7 +134,7 @@ class report_custom(report_rml): 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")) - title += "%s" %product.name + title += "%s" %to_xml(tools.ustr(product.name)) xml += "" + title + prod_header + "" if not bom_id: total_strd = number * product.standard_price