From fa0767e90a591770ed1ea4d4c67360c97cbf9c68 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 22 Nov 2023 17:50:56 +0530 Subject: [PATCH] fix: handle different fieldtypes in Section Fields component --- crm/api/doc.py | 6 ++ crm/fcrm/doctype/crm_deal/crm_deal.json | 4 +- frontend/src/components/SectionFields.vue | 71 ++++++++++++++++------- frontend/src/pages/Deal.vue | 23 -------- frontend/src/pages/Lead.vue | 24 -------- 5 files changed, 59 insertions(+), 69 deletions(-) diff --git a/crm/api/doc.py b/crm/api/doc.py index e09fd90e..4150aaa0 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -172,6 +172,12 @@ def get_type(field): return "phone" elif field.fieldtype == "Data" and field.options == "Email": return "email" + elif field.fieldtype == "Check": + return "checkbox" + elif field.fieldtype == "Int": + return "number" + elif field.fieldtype in ["Small Text", "Text", "Long Text"]: + return "textarea" elif field.read_only: return "read_only" return field.fieldtype.lower() \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 1cc608fc..8e75e2b2 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -40,7 +40,7 @@ { "fetch_from": "organization.annual_revenue", "fieldname": "annual_revenue", - "fieldtype": "Int", + "fieldtype": "Currency", "label": "Amount", "read_only": 1 }, @@ -136,7 +136,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-22 13:26:52.401192", + "modified": "2023-11-22 17:52:31.595525", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Deal", diff --git a/frontend/src/components/SectionFields.vue b/frontend/src/components/SectionFields.vue index d0c2ec27..12d6dbd0 100644 --- a/frontend/src/components/SectionFields.vue +++ b/frontend/src/components/SectionFields.vue @@ -1,5 +1,5 @@