Odoo Help


This community 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.


Automatically Update the "Cost Price" value with the calculated value in "Cost Price (incl. BoM)"??

Damien Taylor
on 9/7/14, 9:09 AM 1,691 views

Hi Guys ,

I am wishing to be able to have the "cost price" of my manufactured items (generated via Manufacture Order) to be calculated as the total "cost price" of each of the bill of materials.

The closest I have found to this solution is by installed the following modules:

  • Product Cost incl. BOM
  • Product Cost incl. BoM and Price History
  • Product Cost field
  • Product Price History

These modules get me so close!  I now have a new field (called "Cost Price (incl. BoM)") added to the product form above the "Cost price".  The value in this field is automatically calculated and updated each time any of the BoM items change their costs via new purchase orders. It also manages the "average cost", which means it is not just updating the Cost of the item with the latest cost, but is averaging the costs which is great!

My only problem is that although the "Cost Price (incl. BoM)" looks perfect... It is not updating the "Cost Price" field which contains the value being used in all of the transactions including the journal created via the Manufacturing order and the customer orders, etc.   Therefore I need to somehow update the "Cost Price" each time the "Cost Price (incl. BoM)"  field changes!  Anybody have any suggestions on the quickest way to do this without needing any coding?

Really appreciate any assistance you can provide!


I couldn't post it as answer since I don't have 20 karma

Akhil P Sivan
on 10/21/14, 3:54 AM

need 20 karma. grrrr. stompid rules: Dear Damien, I the past we also did have a similiar problem. Maybe it's option to make a scheduled rule that updates let's say once per day the costprice. Maybe your module also has a manual update function. So when feel the need to update the cost price you could do it manual. maybe it's easier when I see a example of the running instance. Could you contact me, so maybe I could help you beter? just email..

on 10/21/14, 5:29 AM

Akhil P Sivan

--Akhil P Sivan--
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 12/7/14, 11:13 PM

You can build your own custom module for this requirement instead of using those 4 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

Marek Mosiewicz
On 9/10/14, 1:15 PM

In fact it is not so easy. Probably you need to have average cost of not sold items. In other case you could have difference depending on WHEN you sell the product.

Odoo implementations

On 12/8/14, 3:25 AM


Is it a problem to do it by automatic action? You can schedule it for let's say every day. So you only have 1 day lack in your costprice.

I don't know your branche but from financial perspective this would be acceptable.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)


Asked: 9/7/14, 9:09 AM
Seen: 1691 times
Last updated: 3/16/15, 8:10 AM