# MRP cost price calculation on bom

By
klaas vortex
on 4/30/13, 12:47 PM 15,116 views

A complex product with 3 products A-B-C . A = \$ 10 B = \$ 20 C - \$ 30 So the complex product has at least a \$ 60 dollar cost price. You can print the structure of a BOM, but is there a way to show cost price of each part and add them together ?

Best regards Andre

#### Baiju KS

--Baiju KS--
3297
| 5 5 8
Kochi, India
--Baiju KS--
`ODOO technical`

I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 11/19/14, 6:25 AM

You can build your own custom module for this requirement . You can proceed in these ways: You should first inherit mrp.bom and add a new field 'price_unit': fields.float('Unit Price') and redefine the onchange_product_id function define compute_price and compute_total function to calculate "line price" and "total price" Then you have to inherit mrp.production and define compute_production_cost function to update cost_price from BOM. We have created this custom module and it works perfect , in my module it takes avg purcahse price in BOM and we added an extra tab to manufactring form to compute Production Cost , in that tab you can add extra charges like electicity etc.. , that charges also added to cost by calculating per_unit charge depending on UOM. for any help you can contact: baijuks@hotmail.com

Julius
On 5/29/13, 1:00 PM

The problem is that the report doesn't take modifications made by product_cost_incl_bom. So you have to modify mrp/report/price.py and change two things:

line 68 "std_price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, prod.standard_price, to_uom_id=product_uom.id)" by "std_price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, prod.cost_price, to_uom_id=product_uom.id)"

line 150 "total_strd = number * product.standard_price" by "total_strd = number * product.cost_price"

The module product_cost_incl_bom also have to be modified (!) by changing line 62 "std_price = sub_product.standard_price" by "std_price = sub_product.cost_price" Hope this help.

This solved the problem in the sense that the correct cost price is created at the end of the report. However the "supplier price per unit of measure" is displayed. This is the only things that is still a bit awkward.

Forsberg Services Ltd, Raphael
on 5/30/13, 7:44 AM

You're right, you have to modify the report to make those values reach the real cost price of sub-products/sub-boms.

iMaugis, Julius
on 5/30/13, 8:22 AM
Dale
On 9/5/16, 1:41 PM

Is any of this available in version 9?

Farouk
On 4/3/15, 7:04 AM

Hi every body

can i have a link for those two module" product_cost_incl_bom and product_get_cost_field"\$

thanks

#### Gustavo

--Gustavo--
990
| 2 2 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
On 4/30/13, 1:28 PM

There is a module, product_extended that does that. I don't know if it was ported to OpenERP 7.0

I have been looking into this but I don think to module was ported. But the functionality for costprice calculation is in 7. (See my post)

klaas vortex
on 4/30/13, 1:42 PM
klaas vortex
On 4/30/13, 1:41 PM

I did find the thing I was looking for, it was not where I expect it to be ;-) It is in Warehouse-product. Select Complex Product (which has a Bom) Now use [PRINT][PRODUCT COST STRUCTURE] and there it is !

It will calculate the cost from BOM also. After installing those modules, you try the printing of : Product Cost Structure. It will show you the details.

LEARNER
on 4/30/13, 1:53 PM

Installed the modules and it also calculates the BOM cost including all the parts within a BOM. However when I go to the top level BOM, which includes an other BOM within it, then on the PRODUCT COST STRUCTURE print out the cost is listed as 0.00 GBP. This is a bit weired as the cost field in the subbom is populated correctly. This leads to that the cost price for a BOM, which includes as sub-BOM, is calculated incorrectly. The final cost price only includes items that are not in any sub BOM. Is it possible to calculate the final cost price of a product including all sub BOMs?

Forsberg Services Ltd, Raphael
on 5/23/13, 11:08 AM

You're right! The problem is that the report doesn't take modifications made by product_cost_incl_bom. So you have to modify mrp/report/price.py and change line 150 "total_strd = number * product.standard_price" by "total_strd = number * product.cost_price"

iMaugis, Julius
on 5/29/13, 12:54 PM
LEARNER
On 4/30/13, 1:34 PM

I am not sure about what you are looking for. I installed these modules- product_cost_incl_bom and product_get_cost_field and, it will display Product cost in Product form. You can download it and unzip it and add them into your addons folder. Update your module list, then install it.

I think this will only show the cost price as listed in the product. And not the summation of the past in the BOM (see my answer)

klaas vortex
on 4/30/13, 1:42 PM

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

### Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

1 follower(s)

### Stats

 Asked: 4/30/13, 12:47 PM Seen: 15116 times Last updated: 9/5/16, 1:41 PM