From d70a0e197958424c19aa2ddc05c33af35888866e Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 12 May 2025 16:45:45 +0530 Subject: [PATCH] fix: do not show qty and other fields (cherry picked from commit 8507c204819f0064b5faccbe6f48562c99831bc7) --- crm/fcrm/doctype/crm_products/crm_products.json | 9 +++------ frontend/src/data/script.js | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/crm/fcrm/doctype/crm_products/crm_products.json b/crm/fcrm/doctype/crm_products/crm_products.json index 42fe327b..143f2a1e 100644 --- a/crm/fcrm/doctype/crm_products/crm_products.json +++ b/crm/fcrm/doctype/crm_products/crm_products.json @@ -43,7 +43,6 @@ "bold": 1, "fieldname": "discount_percentage", "fieldtype": "Percent", - "in_list_view": 1, "label": "Discount %" }, { @@ -73,10 +72,9 @@ "bold": 1, "fieldname": "amount", "fieldtype": "Currency", - "in_list_view": 1, "label": "Amount", "options": "currency", - "reqd": 1 + "read_only": 1 }, { "bold": 1, @@ -84,7 +82,6 @@ "description": "Amount after discount", "fieldname": "net_amount", "fieldtype": "Currency", - "in_list_view": 1, "label": "Net Amount", "options": "currency" }, @@ -98,9 +95,9 @@ }, { "bold": 1, + "default": "1", "fieldname": "qty", "fieldtype": "Float", - "in_list_view": 1, "label": "Quantity" } ], @@ -108,7 +105,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2025-04-28 14:41:38.735793", + "modified": "2025-05-12 16:41:00.280290", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Products", diff --git a/frontend/src/data/script.js b/frontend/src/data/script.js index fcde34a9..dd80a955 100644 --- a/frontend/src/data/script.js +++ b/frontend/src/data/script.js @@ -156,8 +156,7 @@ export function getScript(doctype, view = 'Form') { const { getFields } = getMeta(data.doctype) let fields = getFields() let field = fields.find((f) => f.fieldname === parentField) - dt = field.options - dt = dt.replace(/\s+/g, '') + dt = field?.options?.replace(/\s+/g, '') if (!idx && dt) { idx = this.find((r) => r.constructor.name === dt)?.currentRowIdx