OdooWiki OCA HUB

Update costs from purchase

purchase_stock_cost_update folder_open OCA/purchase-workflow open_in_new
Purchase Management License: LGPL-3

This module allows to adjust the valuation of the incoming goods related to their purchase order from the purchase line itself.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets purchasing managers correct the stock valuation of received goods when the purchase price changes, directly from the purchase order. It shows which lines differ and applies the new cost to the valuation layers.

When a purchase order is confirmed and goods are received, the stock value is based on the price at receipt. If the price on the purchase line later changes, this module detects the difference and warns you on the purchase order form.

  • A warning banner appears on the purchase order when any line's price no longer matches the value of the received stock. Affected lines are highlighted in yellow in the order lines list.
  • The banner includes a "Fix valuation" button, available only to users with the Purchase Manager role, and a "Details" button that opens a report showing each affected line and the amount of the difference.
  • The correction is only proposed when the product uses the average cost method, some quantity has been received, and nothing has been invoiced yet.
  • Clicking "Fix valuation" updates the related stock valuation layers with the new cost, creates adjustment layers for quantities already consumed, and recalculates the product's cost.
  • Each valuation layer keeps an "Update history" tab showing who changed the cost, when, and the old and new values.
  • Valuation layers also show the related purchase order line for traceability.

It extends purchase.order, purchase.order.line and stock.valuation.layer, and adds fields and buttons to the purchase order form and the stock valuation layer form.

Depends on

purchase_stock
Models and fields (3)
  • purchase.order · extends an existing modelvaluation_differs, valuation_difference_report
  • purchase.order.line · extends an existing modelvaluation_differs, valuation_difference
  • stock.valuation.layer · extends an existing modelpurchase_line_id, cost_update_history

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 2 confirmed, 7 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/purchase-workflow.

terminal Installation and usage

OCA documentation · Odoo 18.0

In order to use this module, you need to have some storable products valued on average cost (AVCO).

To do so:

  • Go to Inventory > Configuration > Product Categories and select one.
  • In the Inventory valuation section, select the Costing method as Average Cost (AVCO).
  • Now all the products in that category will have that valuation rules.

In order to test the module:

  • Go to Purchase > Orders and create a new quotation.
  • Add a product with AVCO valuation and set a price.
  • Validate the purchase order.
  • Receive the products.
  • The products are now valued at the price you set in the order line.
  • You can check it in Inventory > Reporting > Valuation (debug mode needed).
  • Now change the price in the order line.
  • You'll see that the line has changed its color to yellow and a new button Fix valuation shows up in the header.
  • When you click that button, every disaligned valuation will be fixed. If you go to the Valuation report you'll see the adjustment layer.
  • After this, when you invoice the purchase you won't be able to edit the price anymore.
  • You can anyway add an additional valuation when you post the new invoice prices.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.