From 9f8c9f38d22a284033e45de8f62d0121081ea7d1 Mon Sep 17 00:00:00 2001 From: Harsh Tandiya Date: Wed, 6 Sep 2023 21:56:31 +0530 Subject: [PATCH] chore: beneficiary name in case export --- .../doctype/beneficiary/beneficiary.json | 12 +++++++++--- .../doctype/beneficiary/beneficiary.py | 1 + .../frappe_changemakers/doctype/case/case.json | 16 +++++++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json b/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json index 8ed1f41..9e5e420 100644 --- a/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json +++ b/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json @@ -11,14 +11,15 @@ "personal_information_section", "first_name", "last_name", - "phone_number", + "full_name", "column_break_3", + "phone_number", "gender", "age", - "languages_known", "column_break_4", "religion", "social_category", + "languages_known", "location_section", "state", "district", @@ -364,6 +365,11 @@ "fieldtype": "Data", "label": "Created By", "read_only": 1 + }, + { + "fieldname": "full_name", + "fieldtype": "Data", + "label": "Full Name" } ], "image_field": "image", @@ -390,7 +396,7 @@ "link_fieldname": "beneficiary" } ], - "modified": "2023-09-06 19:31:11.618589", + "modified": "2023-09-06 21:25:52.624848", "modified_by": "Administrator", "module": "Frappe Changemakers", "name": "Beneficiary", diff --git a/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.py b/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.py index 62b7136..1f90bd5 100644 --- a/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.py +++ b/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.py @@ -10,6 +10,7 @@ class Beneficiary(Document): def before_save(self): self.set_created_by() + self.full_name = f"{self.first_name} {self.last_name or ''}" def validate(self): self.validate_age() diff --git a/changemakers/frappe_changemakers/doctype/case/case.json b/changemakers/frappe_changemakers/doctype/case/case.json index 0a0ae59..f488252 100644 --- a/changemakers/frappe_changemakers/doctype/case/case.json +++ b/changemakers/frappe_changemakers/doctype/case/case.json @@ -28,8 +28,9 @@ "beneficiary_details_section", "is_beneficiary_traced", "beneficiary", - "gender", + "full_name", "column_break_jywm", + "gender", "age", "contact_number", "updates_section", @@ -44,7 +45,6 @@ "follow_up_details_section", "family_meeting_outcome", "followups", - "data_cjaa", "section_break_seoz", "created_by", "section_break_yuho", @@ -299,10 +299,6 @@ "fieldname": "column_break_qfjk", "fieldtype": "Column Break" }, - { - "fieldname": "data_cjaa", - "fieldtype": "Data" - }, { "fieldname": "section_break_seoz", "fieldtype": "Section Break" @@ -316,11 +312,17 @@ { "fieldname": "section_break_grcq", "fieldtype": "Section Break" + }, + { + "fetch_from": "beneficiary.full_name", + "fieldname": "full_name", + "fieldtype": "Data", + "label": "Name" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-09-06 14:05:10.045885", + "modified": "2023-09-06 21:55:35.529923", "modified_by": "Administrator", "module": "Frappe Changemakers", "name": "Case",