# Odoo Help

#### Baiju KS

--Baiju KS--
3417
| 6 5 10
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
07/12/14, 23:35

You can build your own custom module for this requirement instead of using those  modules for just one thing. 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 us baijuks@hotmail.com, akhil.p.sivan007@gmail.com

mike
04/07/13, 03:41

I meet a new problem, when I defined product AãBãCãDã

The BOM Struct is Like: A<--2B+C C<--0.2D (that means one D can produce five C)

If the cost price of D is 10\$, I hope see the cost price of C is 2\$, but I see "Cost Price (incl. BoM)" is 0. why ?And the bom cost of report is also wrong, you can see the cost price of sub-product C is 0 in the report.

I find this bug only happens when I try to define a sub-material that it's quantity is float. ( C<--0.2D) , That is, if i define like C<--2Dï¼ all things looks fine!

1 Comment
Metrolux Gmbh, Andreas Marpmann
12/02/14, 03:09

Yes, that's when the "Unit of Measure" is set to another type as reference.

Julius
29/05/13, 13:01

The real problem is not the module itself, but the fact that this report "Product cost structure" isn't modified by the module. 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.

Forsberg Services Ltd, Raphael
30/05/13, 06:11

Thank you for the effort. I tried the two changes you were suggesting but unfortunately the cost for the a product (consisting of a BOM) is still shown as 0.00 within the cost price structure print out.

iMaugis, Julius
30/05/13, 06:23

I modified my answer, you also have to modify line 68, it should work now !

Forsberg Services Ltd, Raphael
30/05/13, 07:43

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.

iMaugis, Julius
30/05/13, 08:21

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

0 follower(s)