Why Maintain Stock and serial or batch settings are locked
When an item has stock transactions, ERPNext makes these Item fields read-only:
- Maintain Stock
- Has Serial No
- Has Batch No
- Is Customer Provided Item
- Has Variants
Why ERPNext locks them
These settings decide how ERPNext counts the stock of an item. A change after stock exists would break the link between the stock that ERPNext shows and the stock you have:
- If you turn off Maintain Stock, the existing stock ledger has quantities that ERPNext no longer tracks.
- The stock of a serialized item is the count of its available serial numbers. If you clear Has Serial No halfway, the stock in reports stops matching.
- Batch-wise stock works the same way for Has Batch No.
If you try to change such a field another way, for example by data import, ERPNext shows a message such as "As there are existing submitted transactions against item ..., you can not change the value of ...".
What to do instead
- The item has test transactions only. Cancel and delete all stock transactions of the item. For a serialized or batch item, also delete its Serial No, Batch, and Serial and Batch Bundle documents. The fields become editable again.
- The item has real transactions. Create a new item with the right settings, and move the stock to it. See Turn on serial or batch numbers for an item that has stock.