Community mailing list archives

Re: Last purchase price costing method?

Eric Caudal
- 12/17/2014 22:41:20
You could use as well the module product_price_history with a little tweak to add the last_purchase_price in the history management.
Ideally you would create a price type linked to the field last_purchase_price and create a pricelist linked to this price type.
So in summary you need to create a field in the product last_purchase_price, change the PO confirmation function to record the last_purchase_price in the product at that time and the rest should be standard Odoo setup.

Hope this is clear enough

2014-12-18 11:02 GMT+08:00 Hardianto Darjoto <>:

You would then need to create new field besides Cost Price, says Last Purchase Price, and when you create PO, this field would be taken instead of Cost Price.

You maybe would need also to create new table Purchase Price History, listing PO Number, date, and Unit Price of the product (in product.product).

Hardianto Darjoto
Odoo (OpenERP) open source business application
+62-21-8370 9595

On Dec 18, 2014 7:54 AM, "OpenERP Master" <> wrote:

I think I mixed up 2 different concepts. Costing method, which is how you value your inventory, and last purchase price, which is used for future purchase orders.

My requirement is that when goods are received that it updates the last purchase price so future purchase orders use that price. With my customer, their purchase prices can change randomly and this is how they want it to work.

I agree on all fronts on how the inventory is valued. I will reword some things in my module so its more clear.

On Wed, Dec 17, 2014 at 10:59 AM, OpenERP Master <> wrote:
Thank you for the feedback everyone. Eva, could you explain that photo? I get distracted by it everytime I see it. ;)

On Wed, Dec 17, 2014 at 8:48 AM, Eva Pinter <> wrote:
When you purchase goods, at the moment the goods enter your stock, you want to valuate them. The methods generally used for it are standard price (you fix the price for a given period) or moving average price (it recalculates the price per unit based on the new purchased done).

Now, when you take away goods from the stock, you want to have one of the 4 strategies:

1. You use the average price
2. You want to use FIFO strategy
3. You want to use LIFO strategy
4. You want to use the standard price

Let’s have a look at the average price.

When using FIFO, the system will search the oldest entry not yet used and take the value from it to calculate the COGS as well as the end value of the stock. For instance, you have bought 10 pieces for 100€ each and then 10 pieces for 200€ each. The average price is 150€.

1. When you use average: you will take away the pieces each for a price of 150€
2. When you use FIFO: The first 10 will be taken away at a price of 100€ and the next 10 at a price of 200€
3. When you use LIFO: The first 10 will be taken away at a price of 200€ and the next 10 at a price of 100€

So, at the moment you take goods, the value of the stock will change differently. The system will recalculate the average price based on the rest value of the stock and the quantities in stock.

I hope this can help clarify the different elements of price of the material.

Best regards

Eva P.

Get free Odoo training in our youtube channel

On 17 Dec 2014, at 08:42, Lionel Sausin <> wrote:

I'm pretty sure LIFO and last price are not the same in many people's workflow.

However there was a very enlightening discussion recently on Odoo[1] and OCA's project "margin-analysis"[2] about last purchase price.

If I understand the expert, adding "last purchase price" as a costing method is probably wrong because it's not a "cost price" as defined by accounting rules.
So, the implementation I'm currently proposing for OCA is to have it computed as a distinct field called "replenishment price".

Please go ahead and test this branch of mine:
Whether you find it fit or not, I'd be glad to read from you on my pull request here:

Post to:

Post to:

Post to:

Post to:

+86 186 21 36 16 70