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.


How to get Average Cost Price including landed costs - Odoo 8

Alejandro Perez Cosio
on 11/13/14, 8:42 AM 1,476 views


Is there a way to get a ponderate price for a product?

I did 2 purchases of the same product with different landed costs:

  • 1st purchase:
    • Units: 100
    • Product cost per unit: 300
    • Landed costs: 500
  • 2nd purchase:
    • Units 30
    • Product cost per unit: 325
    • Landed costs: 250

Now I need to get the Average Cost price of the product + landed costs:

[(100 x 300 + 500) + (30 x 325 + 250)] / (100 + 30) = 311,538

I would like to have this value for a new field in the product_product table, but I'm not sure how to get this calculated value.

I know there is a way to get Average Cost for a product, but I cannot add a landed cost to this and this is why I will use a new field to set this reference value.

So, my question would be:

How could I get the average cost + landed cost for a product?

Thank you for your time and responses
Best regards




| 5 4 8
Kochi, India
ODOO technical and functional

        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

On 12/11/14, 2:00 AM

Hi Alejandro,

You can make your own custom module for this need, You can proceed in this way:-

First of all inherit product.template object and add a custom field avg_price as a functional field.

Then define that function to fetch average of last three purchase price with landed cost. thats all

I have made this module and it works perfect, if you have any doubts feel free to contact, baijuks@hotmail.com


Hello Baiju, thanks for your tips, but the purchase price doesn't include the landed cost.. The module you made is free to get?

Alejandro Perez Cosio
on 12/11/14, 5:37 AM

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

2 follower(s)


Asked: 11/13/14, 8:42 AM
Seen: 1476 times
Last updated: 4/2/15, 4:04 AM