OdooWiki OCA HUB

Stock account move reset to draft

stock_account_move_reset_to_draft folder_open OCA/account-invoicing open_in_new
Warehouse Management License: AGPL-3

This module allows a vendor bill to be reverted to draft status even when an SVL (Stock Valuation Layer) record is created due to a price difference between the receipt and the vendor bill, when inventory from the receipt has yet to be consumed. When a vendor bill is reset to draft, as applicable, a new SVL record is generated to offset the valuation difference that was generated upon the bill's confirmation.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Allows resetting a posted vendor bill to draft even when stock valuation layers exist due to price differences, and automatically creates offsetting valuation entries.

This module extends the vendor bill (account.move) functionality in Odoo. Normally, once a vendor bill is posted and stock valuation layers (SVLs) are created, you cannot reset it to draft. This module changes that: it makes the 'Reset to Draft' button available for posted or cancelled vendor bills that have stock valuation layers on their lines.

When you reset such a bill to draft, the module checks each line that has stock valuation layers. If the inventory from the receipt has already been partially or fully consumed, it raises an error and prevents the reset. If the inventory is still fully available, it creates a new stock valuation layer with the opposite value to offset the original valuation difference. It also updates the product's cost for products using the average cost method.

This ensures that the accounting and inventory valuation stay consistent when you need to correct a vendor bill. The module depends on purchase_stock and works within the accounting and inventory modules.

Depends on

purchase_stock
Models and fields (1)
  • account.move · extends an existing model

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: 3 confirmed, 6 with no information of 9 versions.

Sources · Odoo 17.0

Confirmed on 2026-11-03 in branch 17.0 of OCA/account-invoicing.

terminal Installation and usage

OCA documentation · Odoo 18.0
  • Create a product category with Costing Method: Average Cost (AVCO) or First In First Out (FIFO).
  • Create a product linked to the category created before.
  • Create a purchase order and adds a product line with quantity 1 and price 10.
  • Confirms the purchase order and validates the incoming picking.
  • Creates an invoice from the purchase order.
  • Changes the invoice line price to 12 and confirm the invoice.
  • It is possible to reset the invoice to draft (a new SVL record to offset the existing SVL difference will be created).

When attempting to reset an invoice to draft for a product that has been partially or fully consumed, the system will display the following error message: "The inventory has already been (partially) consumed." In that case, consider using landed costs to adjust the valuation of the product as necessary.

No verified information in OCA: Installation, Configuration.

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.