From cdc62e7327735ebfb1dcc26634bd2c46878fb349 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Sun, 15 Feb 2026 21:06:26 +0530 Subject: [PATCH] chore: do not show serial batch selector if not needed --- .../purchase_invoice_item/purchase_invoice_item.json | 8 +++----- .../doctype/sales_invoice_item/sales_invoice_item.json | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index 42fea055aeb..00951fdd4cc 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -448,7 +448,6 @@ "print_hide": 1 }, { - "depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1", "fieldname": "batch_no", "fieldtype": "Link", "label": "Batch No", @@ -460,14 +459,12 @@ "fieldtype": "Column Break" }, { - "depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1", "fieldname": "serial_no", "fieldtype": "Text", "label": "Serial No", "no_copy": 1 }, { - "depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1", "fieldname": "rejected_serial_no", "fieldtype": "Text", "label": "Rejected Serial No", @@ -578,6 +575,7 @@ }, { "default": "0", + "depends_on": "eval:parent.update_stock", "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "label": "Allow Zero Valuation Rate", @@ -923,7 +921,7 @@ "options": "Asset" }, { - "depends_on": "eval:doc.use_serial_batch_fields === 0 || doc.docstatus === 1", + "depends_on": "eval:doc.use_serial_batch_fields === 0 && doc.docstatus === 0", "fieldname": "add_serial_batch_bundle", "fieldtype": "Button", "label": "Add Serial / Batch No" @@ -993,7 +991,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2026-02-15 20:52:20.097603", + "modified": "2026-02-15 21:07:49.455930", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index ba4c877627e..28a2256e2ec 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -614,7 +614,6 @@ "options": "Quality Inspection" }, { - "depends_on": "eval: doc.use_serial_batch_fields === 1 && parent.update_stock === 1", "fieldname": "batch_no", "fieldtype": "Link", "label": "Batch No", @@ -627,6 +626,7 @@ }, { "default": "0", + "depends_on": "eval:parent.update_stock", "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "label": "Allow Zero Valuation Rate", @@ -634,7 +634,6 @@ "print_hide": 1 }, { - "depends_on": "eval: doc.use_serial_batch_fields === 1 && parent.update_stock === 1", "fieldname": "serial_no", "fieldtype": "Text", "label": "Serial No", @@ -917,6 +916,7 @@ "search_index": 1 }, { + "depends_on": "eval:doc.use_serial_batch_fields === 0 && doc.docstatus === 0", "fieldname": "pick_serial_and_batch", "fieldtype": "Button", "label": "Pick Serial / Batch No" @@ -1009,7 +1009,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2026-02-15 20:50:18.580088", + "modified": "2026-02-15 21:08:57.341638", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item",