From 9da2be23252e205f25758361de5b3cc9c174b700 Mon Sep 17 00:00:00 2001 From: Vishist16 <101823906+Vishist16@users.noreply.github.com> Date: Mon, 11 Aug 2025 10:29:27 +0530 Subject: [PATCH] fix: handle negative inventory check (#48558) (#48691) * fix: handle negative inventory check (#48558) * fix: updated DocField via Desk UI as suggested * fix: update DocField via Desk UI and fix linting issues (cherry picked from commit 3ee23d9ee80b8ac669a74ffbb06997ce9ae4c089) --- erpnext/stock/doctype/item/item.json | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 16ac4fd1017..f0923061e93 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -318,7 +318,8 @@ "fieldname": "shelf_life_in_days", "fieldtype": "Int", "label": "Shelf Life In Days", - "mandatory_depends_on": "eval:doc.has_batch_no && doc.has_expiry_date" + "mandatory_depends_on": "eval:doc.has_batch_no && doc.has_expiry_date", + "non_negative": 1 }, { "default": "2099-12-31", @@ -362,7 +363,8 @@ "depends_on": "is_stock_item", "fieldname": "weight_per_unit", "fieldtype": "Float", - "label": "Weight Per Unit" + "label": "Weight Per Unit", + "non_negative": 1 }, { "depends_on": "eval:doc.is_stock_item", @@ -534,13 +536,15 @@ "fieldname": "min_order_qty", "fieldtype": "Float", "label": "Minimum Order Qty", + "non_negative": 1, "oldfieldname": "min_order_qty", "oldfieldtype": "Currency" }, { "fieldname": "safety_stock", "fieldtype": "Float", - "label": "Safety Stock" + "label": "Safety Stock", + "non_negative": 1 }, { "fieldname": "purchase_details_cb", @@ -551,6 +555,7 @@ "fieldname": "lead_time_days", "fieldtype": "Int", "label": "Lead Time in days", + "non_negative": 1, "oldfieldname": "lead_time_days", "oldfieldtype": "Int" }, @@ -559,6 +564,7 @@ "fieldtype": "Float", "label": "Last Purchase Rate", "no_copy": 1, + "non_negative": 1, "oldfieldname": "last_purchase_rate", "oldfieldtype": "Currency", "read_only": 1 @@ -889,7 +895,7 @@ "image_field": "image", "links": [], "make_attachments_public": 1, - "modified": "2025-02-03 23:43:57.253667", + "modified": "2025-08-08 14:58:48.674193", "modified_by": "Administrator", "module": "Stock", "name": "Item", @@ -954,6 +960,7 @@ } ], "quick_entry": 1, + "row_format": "Dynamic", "search_fields": "item_name,description,item_group,customer_code", "show_name_in_global_search": 1, "show_preview_popup": 1,