From 79ba4ccc129d3a7d05b9e7cafa4162d3c828126b Mon Sep 17 00:00:00 2001 From: Harsh Tandiya Date: Thu, 13 Jul 2023 01:12:50 +0530 Subject: [PATCH] feat: daily visit doctype added --- .../doctype/beneficiary/beneficiary.json | 28 ++++---- .../doctype/daily_visit_update/__init__.py | 0 .../daily_visit_update/daily_visit_update.js | 6 ++ .../daily_visit_update.json | 66 +++++++++++++++++++ .../daily_visit_update/daily_visit_update.py | 11 ++++ .../test_daily_visit_update.py | 9 +++ .../doctype/language_multiselect/__init__.py | 0 .../language_multiselect.json | 36 ++++++++++ .../language_multiselect.py | 9 +++ .../doctype/languages_known/__init__.py | 0 .../languages_known/languages_known.js | 8 +++ .../languages_known/languages_known.json | 49 ++++++++++++++ .../languages_known/languages_known.py | 9 +++ .../languages_known/test_languages_known.py | 9 +++ .../workspace/changemakers/changemakers.json | 19 +++++- 15 files changed, 243 insertions(+), 16 deletions(-) create mode 100644 changemakers/frappe_changemakers/doctype/daily_visit_update/__init__.py create mode 100644 changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.js create mode 100644 changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.json create mode 100644 changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.py create mode 100644 changemakers/frappe_changemakers/doctype/daily_visit_update/test_daily_visit_update.py create mode 100644 changemakers/frappe_changemakers/doctype/language_multiselect/__init__.py create mode 100644 changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.json create mode 100644 changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.py create mode 100644 changemakers/frappe_changemakers/doctype/languages_known/__init__.py create mode 100644 changemakers/frappe_changemakers/doctype/languages_known/languages_known.js create mode 100644 changemakers/frappe_changemakers/doctype/languages_known/languages_known.json create mode 100644 changemakers/frappe_changemakers/doctype/languages_known/languages_known.py create mode 100644 changemakers/frappe_changemakers/doctype/languages_known/test_languages_known.py diff --git a/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json b/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json index 234f87f..705868f 100644 --- a/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json +++ b/changemakers/frappe_changemakers/doctype/beneficiary/beneficiary.json @@ -15,6 +15,7 @@ "column_break_3", "gender", "age", + "languages_known", "column_break_4", "religion", "social_category", @@ -59,9 +60,7 @@ "employment_type", "other_employment_type", "section_break_uwdz", - "bottom_save_button", - "column_break_veps", - "health_camp_record" + "bottom_save_button" ], "fields": [ { @@ -92,6 +91,7 @@ { "fieldname": "habitation", "fieldtype": "Link", + "in_list_view": 1, "label": "Hotspot Name/Habitation", "options": "Habitation" }, @@ -357,20 +357,20 @@ "label": "Save" }, { - "fieldname": "column_break_veps", - "fieldtype": "Column Break" - }, - { - "fieldname": "health_camp_record", - "fieldtype": "Link", - "hidden": 1, - "label": "Health Camp Record", - "options": "Health Camp Attendee" + "fieldname": "languages_known", + "fieldtype": "Table MultiSelect", + "label": "Languages Known", + "options": "Language Multiselect" } ], "image_field": "image", "index_web_pages_for_search": 1, "links": [ + { + "group": "General", + "link_doctype": "Daily Visit Update", + "link_fieldname": "beneficiary" + }, { "group": "General", "link_doctype": "Entitlement Request", @@ -387,7 +387,7 @@ "link_fieldname": "beneficiary" } ], - "modified": "2023-06-30 22:41:53.380509", + "modified": "2023-07-12 23:38:50.889079", "modified_by": "Administrator", "module": "Frappe Changemakers", "name": "Beneficiary", @@ -506,7 +506,7 @@ } ], "quick_entry": 1, - "search_fields": "age,zone,ward", + "search_fields": "age,zone,ward,habitation", "show_title_field_in_link": 1, "sort_field": "modified", "sort_order": "DESC", diff --git a/changemakers/frappe_changemakers/doctype/daily_visit_update/__init__.py b/changemakers/frappe_changemakers/doctype/daily_visit_update/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.js b/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.js new file mode 100644 index 0000000..ee9c57e --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.js @@ -0,0 +1,6 @@ +// Copyright (c) 2023, hussain@frappe.io and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Daily Visit Update", { + refresh(frm) {}, +}); diff --git a/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.json b/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.json new file mode 100644 index 0000000..a32b9c8 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.json @@ -0,0 +1,66 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "format:{date}-DVU{###}", + "creation": "2023-07-12 21:45:41.479782", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "beneficiary", + "date", + "daily_update" + ], + "fields": [ + { + "fieldname": "beneficiary", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Beneficiary", + "options": "Beneficiary", + "reqd": 1 + }, + { + "fieldname": "date", + "fieldtype": "Date", + "in_filter": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Date" + }, + { + "fieldname": "daily_update", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Daily Update" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-07-13 01:07:38.374716", + "modified_by": "Administrator", + "module": "Frappe Changemakers", + "name": "Daily Visit Update", + "naming_rule": "Expression", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.py b/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.py new file mode 100644 index 0000000..09de1c9 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/daily_visit_update/daily_visit_update.py @@ -0,0 +1,11 @@ +# Copyright (c) 2023, hussain@frappe.io and contributors +# For license information, please see license.txt + +from frappe.model.document import Document +from frappe.utils import today + + +class DailyVisitUpdate(Document): + def before_naming(self): + if not self.date: + self.date = today() diff --git a/changemakers/frappe_changemakers/doctype/daily_visit_update/test_daily_visit_update.py b/changemakers/frappe_changemakers/doctype/daily_visit_update/test_daily_visit_update.py new file mode 100644 index 0000000..b4c4b79 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/daily_visit_update/test_daily_visit_update.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, hussain@frappe.io and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestDailyVisitUpdate(FrappeTestCase): + pass diff --git a/changemakers/frappe_changemakers/doctype/language_multiselect/__init__.py b/changemakers/frappe_changemakers/doctype/language_multiselect/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.json b/changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.json new file mode 100644 index 0000000..18891b3 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.json @@ -0,0 +1,36 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2023-07-12 12:16:08.744820", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "language" + ], + "fields": [ + { + "fieldname": "language", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "in_preview": 1, + "in_standard_filter": 1, + "label": "Language", + "options": "Languages Known", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-07-13 00:33:06.838655", + "modified_by": "Administrator", + "module": "Frappe Changemakers", + "name": "Language Multiselect", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.py b/changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.py new file mode 100644 index 0000000..a8a5e23 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/language_multiselect/language_multiselect.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, hussain@frappe.io and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LanguageMultiselect(Document): + pass diff --git a/changemakers/frappe_changemakers/doctype/languages_known/__init__.py b/changemakers/frappe_changemakers/doctype/languages_known/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/changemakers/frappe_changemakers/doctype/languages_known/languages_known.js b/changemakers/frappe_changemakers/doctype/languages_known/languages_known.js new file mode 100644 index 0000000..d17e3d0 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/languages_known/languages_known.js @@ -0,0 +1,8 @@ +// Copyright (c) 2023, hussain@frappe.io and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Languages Known", { +// refresh(frm) { + +// }, +// }); diff --git a/changemakers/frappe_changemakers/doctype/languages_known/languages_known.json b/changemakers/frappe_changemakers/doctype/languages_known/languages_known.json new file mode 100644 index 0000000..4e9152d --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/languages_known/languages_known.json @@ -0,0 +1,49 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:language", + "creation": "2023-07-12 12:09:50.910956", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "language" + ], + "fields": [ + { + "fieldname": "language", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Language", + "reqd": 1, + "unique": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-07-13 00:33:45.657027", + "modified_by": "Administrator", + "module": "Frappe Changemakers", + "name": "Languages Known", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/changemakers/frappe_changemakers/doctype/languages_known/languages_known.py b/changemakers/frappe_changemakers/doctype/languages_known/languages_known.py new file mode 100644 index 0000000..624f128 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/languages_known/languages_known.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, hussain@frappe.io and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LanguagesKnown(Document): + pass diff --git a/changemakers/frappe_changemakers/doctype/languages_known/test_languages_known.py b/changemakers/frappe_changemakers/doctype/languages_known/test_languages_known.py new file mode 100644 index 0000000..21cdef2 --- /dev/null +++ b/changemakers/frappe_changemakers/doctype/languages_known/test_languages_known.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, hussain@frappe.io and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestLanguagesKnown(FrappeTestCase): + pass diff --git a/changemakers/frappe_changemakers/workspace/changemakers/changemakers.json b/changemakers/frappe_changemakers/workspace/changemakers/changemakers.json index fb8a920..d994d25 100644 --- a/changemakers/frappe_changemakers/workspace/changemakers/changemakers.json +++ b/changemakers/frappe_changemakers/workspace/changemakers/changemakers.json @@ -1,7 +1,8 @@ { "charts": [], - "content": "[{\"id\":\"CecwNbV5Aq\",\"type\":\"header\",\"data\":{\"text\":\"Frappe Changemakers\",\"col\":12}},{\"id\":\"I9e4OurK7Y\",\"type\":\"paragraph\",\"data\":{\"text\":\" Manage Beneficiaries\",\"col\":12}},{\"id\":\"JhoJIvxYwo\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Beneficiary\",\"col\":3}},{\"id\":\"PMA7sL0zHl\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Beneficiaries\",\"col\":3}},{\"id\":\"GlS-4ygjkT\",\"type\":\"paragraph\",\"data\":{\"text\":\"Rescues\",\"col\":12}},{\"id\":\"W7ZBgFg0CJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Rescue\",\"col\":3}},{\"id\":\"TEcaVdnIhr\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Rescues\",\"col\":3}},{\"id\":\"g2frCR54Gw\",\"type\":\"paragraph\",\"data\":{\"text\":\"Cases\",\"col\":12}},{\"id\":\"YY4UpDO22w\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"My Cases\",\"col\":3}},{\"id\":\"o-NQxJOqB9\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Case\",\"col\":3}},{\"id\":\"1X_H_JUulh\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Open Cases\",\"col\":3}},{\"id\":\"2faOuV0vIj\",\"type\":\"paragraph\",\"data\":{\"text\":\"Entitlements\",\"col\":12}},{\"id\":\"xllISW0jRt\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Entitlements\",\"col\":3}},{\"id\":\"wjYeZ-C3Yj\",\"type\":\"paragraph\",\"data\":{\"text\":\"Food\",\"col\":12}},{\"id\":\"mB90BbrugG\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Distribution\",\"col\":3}},{\"id\":\"2Dxn3AA-OY\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Distributions\",\"col\":3}},{\"id\":\"2qZW9NgrCQ\",\"type\":\"paragraph\",\"data\":{\"text\":\"Healthcare\",\"col\":12}},{\"id\":\"JYx1hK5EYf\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Hospitalisation Record\",\"col\":3}},{\"id\":\"aGZflLrU8F\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Healthcare Providers\",\"col\":3}},{\"id\":\"SMiDbH7oHO\",\"type\":\"paragraph\",\"data\":{\"text\":\"Shelter Services\",\"col\":12}},{\"id\":\"_zTFcA698A\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Shelter Homes\",\"col\":4}},{\"id\":\"ZMLz_em53Q\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Create Entry Record\",\"col\":3}},{\"id\":\"j51o5hQMDV\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Create Exit Record\",\"col\":3}},{\"id\":\"hIEZu5hDaF\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"2QJ1oA29Tv\",\"type\":\"paragraph\",\"data\":{\"text\":\"Others\",\"col\":12}},{\"id\":\"a3oRewN8WJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Family Reintegrations\",\"col\":3}},{\"id\":\"AtcrGpwYkn\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Awareness Camps\",\"col\":3}},{\"id\":\"vOv18I4R0A\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Health Camps\",\"col\":3}}]", + "content": "[{\"id\":\"CecwNbV5Aq\",\"type\":\"header\",\"data\":{\"text\":\"Frappe Changemakers\",\"col\":12}},{\"id\":\"I9e4OurK7Y\",\"type\":\"paragraph\",\"data\":{\"text\":\" Manage Beneficiaries\",\"col\":12}},{\"id\":\"JhoJIvxYwo\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Beneficiary\",\"col\":3}},{\"id\":\"PMA7sL0zHl\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Beneficiaries\",\"col\":3}},{\"id\":\"j_2-NL3927\",\"type\":\"paragraph\",\"data\":{\"text\":\"Daily Visit Update\",\"col\":12}},{\"id\":\"arnB4anEZl\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Daily Visit Update\",\"col\":3}},{\"id\":\"lB7YAlkP4m\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Daily Visit Update List\",\"col\":4}},{\"id\":\"GlS-4ygjkT\",\"type\":\"paragraph\",\"data\":{\"text\":\"Rescues\",\"col\":12}},{\"id\":\"W7ZBgFg0CJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Rescue\",\"col\":3}},{\"id\":\"TEcaVdnIhr\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Rescues\",\"col\":3}},{\"id\":\"g2frCR54Gw\",\"type\":\"paragraph\",\"data\":{\"text\":\"Cases\",\"col\":12}},{\"id\":\"YY4UpDO22w\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"My Cases\",\"col\":3}},{\"id\":\"o-NQxJOqB9\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Case\",\"col\":3}},{\"id\":\"1X_H_JUulh\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Open Cases\",\"col\":3}},{\"id\":\"2faOuV0vIj\",\"type\":\"paragraph\",\"data\":{\"text\":\"Entitlements\",\"col\":12}},{\"id\":\"xllISW0jRt\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Entitlements\",\"col\":3}},{\"id\":\"wjYeZ-C3Yj\",\"type\":\"paragraph\",\"data\":{\"text\":\"Food\",\"col\":12}},{\"id\":\"mB90BbrugG\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Distribution\",\"col\":3}},{\"id\":\"2Dxn3AA-OY\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Distributions\",\"col\":3}},{\"id\":\"2qZW9NgrCQ\",\"type\":\"paragraph\",\"data\":{\"text\":\"Healthcare\",\"col\":12}},{\"id\":\"JYx1hK5EYf\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Hospitalisation Record\",\"col\":3}},{\"id\":\"aGZflLrU8F\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Healthcare Providers\",\"col\":3}},{\"id\":\"SMiDbH7oHO\",\"type\":\"paragraph\",\"data\":{\"text\":\"Shelter Services\",\"col\":12}},{\"id\":\"_zTFcA698A\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Shelter Homes\",\"col\":4}},{\"id\":\"ZMLz_em53Q\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Create Entry Record\",\"col\":3}},{\"id\":\"j51o5hQMDV\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Create Exit Record\",\"col\":3}},{\"id\":\"hIEZu5hDaF\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"2QJ1oA29Tv\",\"type\":\"paragraph\",\"data\":{\"text\":\"Others\",\"col\":12}},{\"id\":\"a3oRewN8WJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Family Reintegrations\",\"col\":3}},{\"id\":\"AtcrGpwYkn\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Awareness Camps\",\"col\":3}},{\"id\":\"vOv18I4R0A\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Health Camps\",\"col\":3}}]", "creation": "2022-10-13 13:51:43.725589", + "custom_blocks": [], "docstatus": 0, "doctype": "Workspace", "for_user": "", @@ -11,7 +12,7 @@ "is_hidden": 0, "label": "Changemakers", "links": [], - "modified": "2023-03-11 19:45:22.159458", + "modified": "2023-07-13 01:10:23.842165", "modified_by": "Administrator", "module": "Frappe Changemakers", "name": "Changemakers", @@ -28,6 +29,13 @@ "roles": [], "sequence_id": 1.0, "shortcuts": [ + { + "color": "Grey", + "doc_view": "New", + "label": "New Daily Visit Update", + "link_to": "Daily Visit Update", + "type": "DocType" + }, { "color": "Grey", "doc_view": "New", @@ -35,6 +43,13 @@ "link_to": "Case", "type": "DocType" }, + { + "color": "Grey", + "doc_view": "List", + "label": "All Daily Visit Update List", + "link_to": "Daily Visit Update", + "type": "DocType" + }, { "color": "Grey", "doc_view": "New",