Skip to content

Commit

Permalink
chore: beneficiary name in case export
Browse files Browse the repository at this point in the history
  • Loading branch information
harshtandiya committed Sep 6, 2023
1 parent fad2e8e commit 9f8c9f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -364,6 +365,11 @@
"fieldtype": "Data",
"label": "Created By",
"read_only": 1
},
{
"fieldname": "full_name",
"fieldtype": "Data",
"label": "Full Name"
}
],
"image_field": "image",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
16 changes: 9 additions & 7 deletions changemakers/frappe_changemakers/doctype/case/case.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"beneficiary_details_section",
"is_beneficiary_traced",
"beneficiary",
"gender",
"full_name",
"column_break_jywm",
"gender",
"age",
"contact_number",
"updates_section",
Expand All @@ -44,7 +45,6 @@
"follow_up_details_section",
"family_meeting_outcome",
"followups",
"data_cjaa",
"section_break_seoz",
"created_by",
"section_break_yuho",
Expand Down Expand Up @@ -299,10 +299,6 @@
"fieldname": "column_break_qfjk",
"fieldtype": "Column Break"
},
{
"fieldname": "data_cjaa",
"fieldtype": "Data"
},
{
"fieldname": "section_break_seoz",
"fieldtype": "Section Break"
Expand All @@ -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",
Expand Down

0 comments on commit 9f8c9f3

Please sign in to comment.