diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 2bfab5dd6ca..e953ce942b0 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -42,6 +42,8 @@ class report_custom(report_rml): rml_obj.localcontext.update({'lang':context.get('lang',False)}) company_currency = user_pool.browse(cr, uid, uid).company_id.currency_id company_currency_symbol = company_currency.symbol or company_currency.name + product_uom_digits = rml_obj.get_digits(dp='Product Unit of Measure') + purchase_price_digits = rml_obj.get_digits(dp='Product Price') def process_bom(bom, currency_id, factor=1): xml = '' sum = 0 @@ -63,7 +65,7 @@ class report_custom(report_rml): 'uom': prod.uom_po_id.id, 'date': time.strftime('%Y-%m-%d'), })[pricelist.id] - main_sp_price = """"""+rml_obj.formatLang(price)+' '+ (company_currency_symbol)+"""\r\n""" + main_sp_price = """"""+rml_obj.formatLang(price, digits=purchase_price_digits)+' '+ (company_currency_symbol)+"""\r\n""" sum += prod_qtty*price std_price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, prod.standard_price, to_uom_id=product_uom.id) main_strd_price = str(std_price) + '\r\n' @@ -78,11 +80,11 @@ class report_custom(report_rml): 'uom': prod.uom_po_id.id, 'date': time.strftime('%Y-%m-%d'), })[pricelist.id] - sellers_price += """"""+rml_obj.formatLang(price) +' '+ (company_currency_symbol) +"""\r\n""" + sellers_price += """"""+rml_obj.formatLang(price, digits=purchase_price_digits) +' '+ (company_currency_symbol) +"""\r\n""" xml += """ """+ prod_name +""" """+ main_sp_name + sellers + """ - """+ rml_obj.formatLang(prod_qtty) +' '+ product_uom_name +""" - """+ rml_obj.formatLang(float(main_strd_price)) +' '+ (company_currency_symbol) +""" + """+ rml_obj.formatLang(prod_qtty, digits=product_uom_digits) +' '+ product_uom_name +""" + """+ rml_obj.formatLang(float(main_strd_price), digits=purchase_price_digits) +' '+ (company_currency_symbol) +""" """ + main_sp_price + sellers_price + """'""" xml += '' @@ -140,8 +142,6 @@ class report_custom(report_rml): """ % (_('Components'), _('Components suppliers'), _('Quantity'),_('Cost Price per Unit of Measure'), _('Supplier Price per Unit of Measure')) - purchase_price_digits = rml_obj.get_digits(dp='Product Price') - for product in product_pool.browse(cr, uid, ids, context=context): product_uom_name = to_xml(product.uom_id.name) bom_id = bom_pool._bom_find(cr, uid, product.id, product.uom_id.id)