diff --git a/README.md b/README.md index 3c47212..f6f69c8 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,10 @@ This module allows for the retrospective adjustment of product costs and Cost of * **Accounting Date**: **End Date** of the Readjustment Period. * **Reference**: Includes POS Order and POS Session Name for easy reconciliation. +### 4. Scrap / Inventory Loss Adjustment +* **Trigger**: Moves to a location with Usage "Inventory Loss" (e.g., Scrap/Spoil) where the move is flagged as a Scrap operation or the location is a designated Scrap Location. +* **Account Selection**: Prioritizes the **Location's Incoming Stock Valuation Account** as the counterpart (Expense/Loss account) if configured. This overrides the default Product Category Stock Output account, ensuring precise allocation of losses to specific accounts (e.g., "Waste & Damage Inventory"). + ## Usage 1. Go to **Inventory > Operations > Stock Readjustment**. diff --git a/models/stock_readjust_valuation.py b/models/stock_readjust_valuation.py index efe3bbf..29f405f 100644 --- a/models/stock_readjust_valuation.py +++ b/models/stock_readjust_valuation.py @@ -600,6 +600,11 @@ class StockReadjustValuation(models.Model): debit_acc = val credit_acc = stock else: + # Check for Scrap / Inventory Loss + if move.location_dest_id.usage == 'inventory' and (move.scrapped or move.location_dest_id.scrap_location): + if move.location_dest_id.valuation_in_account_id: + stock = move.location_dest_id.valuation_in_account_id.id + debit_acc = stock credit_acc = val