diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index 1ca7473c51c..1ac18654085 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -4,7 +4,7 @@ "author" : "Tiny", "website" : "http://tinyerp.com/module_mrp.html", "category" : "Generic Modules/Production", - "depends" : ["stock", "hr", "purchase"], + "depends" : ["stock", "hr", "purchase", "product"], "description": "Manage the manufacturing process: procurement, scheduler computation, bill of materials, routings, procurements, production orders, workcenters, eso.", "init_xml" : [], "demo_xml" : ["mrp_demo.xml","mrp_order_point.xml"], diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 96ad2bfc153..17ddb1ca809 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -53,29 +53,29 @@ class report_custom(report_rml): main_strd_price = '' if prod.seller_ids and prod.seller_ids[0] : main_sp_name = '' + prod.seller_ids[0].name.name + '\r\n' - pricelist = ir.ir_get(cr,uid,'meta','product.pricelist.purchase',[('res.partner',prod.seller_ids[0].name.id)]) + pricelist = prod.seller_ids[0].name.property_product_pricelist_purchase if pricelist: - pricelist_id = pricelist[0][2] - price = pooler.get_pool(cr.dbname).get('product.pricelist').price_get(cr,uid,[pricelist_id], prod.id, number*prod_qtty or 1.0)[pricelist_id] + pricelist_id = pricelist[0] + price = pooler.get_pool(cr.dbname).get('product.pricelist').price_get(cr,uid,[pricelist_id], prod.id, number*prod_qtty or 1.0).setdefault(pricelist_id, 0) else: price = 0 - main_sp_price = str(price) + '\r\n' + main_sp_price = '%.2f' % price + '\r\n' sum += prod_qtty*price - main_strd_price = str(prod.standard_price) + '\r\n' + main_strd_price = '%.2f' % prod.standard_price + '\r\n' sum_strd = prod_qtty*prod.standard_price sellers = '' sellers_price = '' for seller_id in prod.seller_ids: sellers += '- '+ seller_id.name.name +'\r\n' - pricelist = ir.ir_get(cr,uid,'meta','product.pricelist.purchase',[('res.partner',seller_id.name.id)]) + pricelist = seller_id.name.property_product_pricelist_purchase if pricelist: - pricelist_id = pricelist[0][2] - price = pooler.get_pool(cr.dbname).get('product.pricelist').price_get(cr,uid,[pricelist_id], prod.id, number*prod_qtty or 1.0)[pricelist_id] + pricelist_id = pricelist[0] + price = pooler.get_pool(cr.dbname).get('product.pricelist').price_get(cr,uid,[pricelist_id], prod.id, number*prod_qtty or 1.0).setdefault(pricelist_id, 0) else: price = 0 - sellers_price += '-' + str(price) + '\r\n' + sellers_price += '%.2f' % price + '\r\n' xml += "