From 73a3a2f19b145ee8d334adac26aac5917b3d20c4 Mon Sep 17 00:00:00 2001 From: OsCoder Date: Tue, 17 Mar 2026 21:22:22 +0000 Subject: Create person doctype - includes child doctype for counterpart and residence --- .../supportive_help/doctype/__init__.py | 0 .../supportive_help/doctype/sh_person/__init__.py | 0 .../supportive_help/doctype/sh_person/sh_person.js | 8 + .../doctype/sh_person/sh_person.json | 258 +++++++++++++++++++++ .../supportive_help/doctype/sh_person/sh_person.py | 11 + .../doctype/sh_person/test_sh_person.py | 9 + .../doctype/sh_person_counterpart/__init__.py | 0 .../sh_person_counterpart.json | 53 +++++ .../sh_person_counterpart/sh_person_counterpart.py | 9 + .../doctype/sh_residence/__init__.py | 0 .../doctype/sh_residence/sh_residence.json | 79 +++++++ .../doctype/sh_residence/sh_residence.py | 9 + .../workspace/supportive_help/supportive_help.json | 17 +- supportive_help/translations/de.csv | 60 +++-- supportive_help/translations/en.csv | 6 +- 15 files changed, 500 insertions(+), 19 deletions(-) create mode 100644 supportive_help/supportive_help/doctype/__init__.py create mode 100644 supportive_help/supportive_help/doctype/sh_person/__init__.py create mode 100644 supportive_help/supportive_help/doctype/sh_person/sh_person.js create mode 100644 supportive_help/supportive_help/doctype/sh_person/sh_person.json create mode 100644 supportive_help/supportive_help/doctype/sh_person/sh_person.py create mode 100644 supportive_help/supportive_help/doctype/sh_person/test_sh_person.py create mode 100644 supportive_help/supportive_help/doctype/sh_person_counterpart/__init__.py create mode 100644 supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.json create mode 100644 supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.py create mode 100644 supportive_help/supportive_help/doctype/sh_residence/__init__.py create mode 100644 supportive_help/supportive_help/doctype/sh_residence/sh_residence.json create mode 100644 supportive_help/supportive_help/doctype/sh_residence/sh_residence.py diff --git a/supportive_help/supportive_help/doctype/__init__.py b/supportive_help/supportive_help/doctype/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/supportive_help/supportive_help/doctype/sh_person/__init__.py b/supportive_help/supportive_help/doctype/sh_person/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/supportive_help/supportive_help/doctype/sh_person/sh_person.js b/supportive_help/supportive_help/doctype/sh_person/sh_person.js new file mode 100644 index 0000000..055a299 --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_person/sh_person.js @@ -0,0 +1,8 @@ +// Copyright (c) 2026, Leon Zimmermann and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("sh_person", { +// refresh(frm) { + +// }, +// }); diff --git a/supportive_help/supportive_help/doctype/sh_person/sh_person.json b/supportive_help/supportive_help/doctype/sh_person/sh_person.json new file mode 100644 index 0000000..9552470 --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_person/sh_person.json @@ -0,0 +1,258 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2026-03-17 20:50:36.742534", + "default_view": "List", + "doctype": "DocType", + "document_type": "Document", + "engine": "InnoDB", + "field_order": [ + "first_name", + "column_break_ebpi", + "last_name", + "date_of_birth", + "contact_tab", + "telephone", + "mobile_phone", + "email", + "more_information_tab", + "personal_information_section", + "health_insurance", + "health_insurance_membership_number", + "column_break_hptn", + "gender", + "column_break_rwri", + "level_of_care", + "handicapped_pass_level_of_care", + "handicapped_person", + "membership_numbers_section", + "social_institution_membership_number", + "preschool_reduction_membership_number", + "education_card_membership_number", + "childcare_benefit_membership_number", + "residence_tab", + "residence", + "counterpart_tab", + "counterpart", + "connections_tab" + ], + "fields": [ + { + "fieldname": "first_name", + "fieldtype": "Data", + "label": "First Name", + "length": 64, + "options": "Name", + "reqd": 1 + }, + { + "fieldname": "column_break_ebpi", + "fieldtype": "Column Break" + }, + { + "fieldname": "last_name", + "fieldtype": "Data", + "label": "Last Name", + "length": 64, + "options": "Name", + "reqd": 1 + }, + { + "fieldname": "date_of_birth", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Date of Birth", + "reqd": 1 + }, + { + "fieldname": "residence_tab", + "fieldtype": "Tab Break", + "label": "Residence" + }, + { + "fieldname": "residence", + "fieldtype": "Table", + "label": "Residence", + "options": "sh_residence" + }, + { + "fieldname": "contact_tab", + "fieldtype": "Tab Break", + "label": "Contact" + }, + { + "fieldname": "telephone", + "fieldtype": "Data", + "label": "Telephone", + "length": 64, + "options": "Phone" + }, + { + "fieldname": "mobile_phone", + "fieldtype": "Data", + "label": "Mobile phone", + "length": 64, + "options": "Phone" + }, + { + "fieldname": "counterpart_tab", + "fieldtype": "Tab Break", + "label": "Counterpart" + }, + { + "fieldname": "counterpart", + "fieldtype": "Table", + "label": "Counterpart", + "options": "sh_person_counterpart" + }, + { + "fieldname": "more_information_tab", + "fieldtype": "Tab Break", + "label": "More Information" + }, + { + "fieldname": "health_insurance", + "fieldtype": "Data", + "label": "Health Insurance", + "length": 64 + }, + { + "fieldname": "health_insurance_membership_number", + "fieldtype": "Data", + "label": "Membership Number", + "length": 64 + }, + { + "fieldname": "column_break_hptn", + "fieldtype": "Column Break" + }, + { + "fieldname": "gender", + "fieldtype": "Link", + "label": "Gender", + "options": "Gender" + }, + { + "fieldname": "column_break_rwri", + "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "handicapped_person", + "fieldtype": "Check", + "label": "Handicapped Person" + }, + { + "default": "0", + "fieldname": "level_of_care", + "fieldtype": "Int", + "label": "Level of Care", + "length": 1, + "non_negative": 1 + }, + { + "fieldname": "personal_information_section", + "fieldtype": "Section Break", + "label": "Personal Information" + }, + { + "fieldname": "membership_numbers_section", + "fieldtype": "Section Break", + "label": "Membership Numbers" + }, + { + "fieldname": "social_institution_membership_number", + "fieldtype": "Data", + "label": "Social Institution Membership Number", + "length": 64 + }, + { + "fieldname": "preschool_reduction_membership_number", + "fieldtype": "Data", + "label": "Preschool Reduction Membership Number", + "length": 64 + }, + { + "fieldname": "education_card_membership_number", + "fieldtype": "Data", + "label": "Education Card Membership Number", + "length": 64 + }, + { + "fieldname": "childcare_benefit_membership_number", + "fieldtype": "Data", + "label": "Child Care Benefit Membership Number", + "length": 64 + }, + { + "default": "0", + "depends_on": "eval:doc.handicapped_person == 1", + "fieldname": "handicapped_pass_level_of_care", + "fieldtype": "Int", + "label": "Handicapped Pass Level of Care", + "length": 1, + "non_negative": 1 + }, + { + "fieldname": "email", + "fieldtype": "Data", + "label": "Email", + "length": 64, + "options": "Email" + }, + { + "fieldname": "connections_tab", + "fieldtype": "Tab Break", + "label": "Connections" + } + ], + "grid_page_length": 50, + "index_web_pages_for_search": 1, + "links": [], + "modified": "2026-03-17 22:16:47.133332", + "modified_by": "Administrator", + "module": "Supportive Help", + "name": "sh_person", + "naming_rule": "By script", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Supportive Help Manager", + "share": 1, + "write": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Supportive Help User", + "share": 1 + } + ], + "row_format": "Dynamic", + "rows_threshold_for_grid_search": 20, + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/supportive_help/supportive_help/doctype/sh_person/sh_person.py b/supportive_help/supportive_help/doctype/sh_person/sh_person.py new file mode 100644 index 0000000..9620711 --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_person/sh_person.py @@ -0,0 +1,11 @@ +# Copyright (c) 2026, Leon Zimmermann and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class sh_person(Document): + def autoname(self): + # select a project name based on customer + self.name = f"{self.last_name}, {self.first_name}" diff --git a/supportive_help/supportive_help/doctype/sh_person/test_sh_person.py b/supportive_help/supportive_help/doctype/sh_person/test_sh_person.py new file mode 100644 index 0000000..6bc387b --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_person/test_sh_person.py @@ -0,0 +1,9 @@ +# Copyright (c) 2026, Leon Zimmermann and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class Testsh_person(FrappeTestCase): + pass diff --git a/supportive_help/supportive_help/doctype/sh_person_counterpart/__init__.py b/supportive_help/supportive_help/doctype/sh_person_counterpart/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.json b/supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.json new file mode 100644 index 0000000..0680ccb --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.json @@ -0,0 +1,53 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2026-03-17 21:29:05.809027", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "full_name", + "telephone", + "type" + ], + "fields": [ + { + "fieldname": "full_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Full Name", + "length": 64, + "reqd": 1 + }, + { + "fieldname": "telephone", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Telephone", + "length": 64, + "options": "Phone" + }, + { + "fieldname": "type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Type", + "options": "school assistant\noutpatient care\nlegal guardian\ncompensatory assistant\nmiscellaneous\npreschool\nschool\nearly intervention\ndaycare\nasylum\ninstitution\nsocial institution\ndoctor\npediatrician\npsychologist\nclinic\nhospital\nemployment agency\ncredit counseling" + } + ], + "grid_page_length": 50, + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2026-03-17 21:55:41.537429", + "modified_by": "Administrator", + "module": "Supportive Help", + "name": "sh_person_counterpart", + "owner": "Administrator", + "permissions": [], + "row_format": "Dynamic", + "rows_threshold_for_grid_search": 20, + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.py b/supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.py new file mode 100644 index 0000000..a3641ec --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_person_counterpart/sh_person_counterpart.py @@ -0,0 +1,9 @@ +# Copyright (c) 2026, Leon Zimmermann and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class sh_person_counterpart(Document): + pass diff --git a/supportive_help/supportive_help/doctype/sh_residence/__init__.py b/supportive_help/supportive_help/doctype/sh_residence/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/supportive_help/supportive_help/doctype/sh_residence/sh_residence.json b/supportive_help/supportive_help/doctype/sh_residence/sh_residence.json new file mode 100644 index 0000000..ef2cf7a --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_residence/sh_residence.json @@ -0,0 +1,79 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2026-03-17 21:03:34.148824", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "street", + "house_number", + "column_break_wjfm", + "postcode", + "city", + "section_break_rnor", + "valid_from" + ], + "fields": [ + { + "fieldname": "street", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Street", + "options": "Name", + "reqd": 1 + }, + { + "fieldname": "postcode", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Postcode", + "reqd": 1 + }, + { + "fieldname": "column_break_wjfm", + "fieldtype": "Column Break" + }, + { + "fieldname": "house_number", + "fieldtype": "Data", + "in_list_view": 1, + "label": "House Number", + "reqd": 1 + }, + { + "fieldname": "city", + "fieldtype": "Data", + "in_list_view": 1, + "label": "City", + "options": "Name", + "reqd": 1 + }, + { + "fieldname": "section_break_rnor", + "fieldtype": "Section Break" + }, + { + "fieldname": "valid_from", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Valid from", + "reqd": 1 + } + ], + "grid_page_length": 50, + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2026-03-17 21:18:11.184635", + "modified_by": "Administrator", + "module": "Supportive Help", + "name": "sh_residence", + "owner": "Administrator", + "permissions": [], + "row_format": "Dynamic", + "rows_threshold_for_grid_search": 20, + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/supportive_help/supportive_help/doctype/sh_residence/sh_residence.py b/supportive_help/supportive_help/doctype/sh_residence/sh_residence.py new file mode 100644 index 0000000..c200efd --- /dev/null +++ b/supportive_help/supportive_help/doctype/sh_residence/sh_residence.py @@ -0,0 +1,9 @@ +# Copyright (c) 2026, Leon Zimmermann and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class sh_residence(Document): + pass diff --git a/supportive_help/supportive_help/workspace/supportive_help/supportive_help.json b/supportive_help/supportive_help/workspace/supportive_help/supportive_help.json index fedda7f..46769e4 100644 --- a/supportive_help/supportive_help/workspace/supportive_help/supportive_help.json +++ b/supportive_help/supportive_help/workspace/supportive_help/supportive_help.json @@ -1,19 +1,19 @@ { "charts": [], - "content": "[{\"id\":\"5k1vjcvtDa\",\"type\":\"header\",\"data\":{\"text\":\"Supportive Help\",\"col\":12}}]", + "content": "[{\"id\":\"5k1vjcvtDa\",\"type\":\"header\",\"data\":{\"text\":\"Supportive Help\",\"col\":12}},{\"id\":\"ZNKb-vbrCD\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Person\",\"col\":3}}]", "creation": "2026-03-17 19:53:22.895091", "custom_blocks": [], "docstatus": 0, "doctype": "Workspace", "for_user": "", "hide_custom": 0, - "icon": "users", + "icon": "share-people", "idx": 0, "indicator_color": "blue", "is_hidden": 0, "label": "Supportive Help", "links": [], - "modified": "2026-03-17 20:02:48.949327", + "modified": "2026-03-17 22:18:56.905409", "modified_by": "Administrator", "module": "Supportive Help", "name": "Supportive Help", @@ -31,6 +31,15 @@ } ], "sequence_id": 28.0, - "shortcuts": [], + "shortcuts": [ + { + "color": "Grey", + "doc_view": "List", + "label": "Person", + "link_to": "sh_person", + "stats_filter": "[]", + "type": "DocType" + } + ], "title": "Supportive Help" } \ No newline at end of file diff --git a/supportive_help/translations/de.csv b/supportive_help/translations/de.csv index 739403b..94e2f0c 100644 --- a/supportive_help/translations/de.csv +++ b/supportive_help/translations/de.csv @@ -1,13 +1,47 @@ -"source_string","translated_string","context" -"supportive_help","supportive_help","app technical name" -"Supportive Help","Unterstützende Hilfe","app display name" -"Supportive Help Manager","Unterstüzende Hilfe Manager","role name" -"Supportive Help User","Unterstüzende Hilfe Benutzer","role name" -"sh_person","Person","table name" -"Date of Birth","Geburtstag","" -"House Number","Hausnummer","" -"Postcode","Postleitzahl","" -"Residence","Wohnsitz","" -"Street","Straße","" -"Valid from","Gültig ab","" -"sh_residence","Wohnsitz","" \ No newline at end of file +"source_string","translated_string" +"supportive_help","supportive_help" +"Supportive Help","Unterstützende Hilfe" +"Supportive Help Manager","Unterstüzende Hilfe Manager" +"Supportive Help User","Unterstüzende Hilfe Benutzer" +"sh_person","Person" +"Date of Birth","Geburtstag" +"House Number","Hausnummer" +"Postcode","Postleitzahl" +"Residence","Wohnsitz" +"Street","Straße" +"Valid from","Gültig ab" +"sh_residence","Wohnsitz" +"Counterpart","Ansprechpartner" +"Mobile phone","Mobiltelefon" +"Telephone","Telefon" +"asylum","Heim" +"clinic","Klinik" +"compensatory assistant","Kompensatorischer Assistent*in" +"credit counseling","Schuldnerberatung" +"daycare","Tagesgruppe" +"doctor","Arzt" +"early intervention","Frühförderung" +"employment agency","Arbeitsamt" +"hospital","Krankenhaus" +"institution","Institution" +"legal guardian","Gesetzlicher Betreuer*in" +"miscellaneous","Sonstiges" +"outpatient care","Ambulante Betreuung (EGH)" +"pediatrician","Kinderarzt*in" +"preschool","Kindergarten" +"psychologist","Psychologe*in" +"school","Schule" +"school assistant","Schulbegleiter*in" +"sh_person_counterpart","Ansprechpartner" +"Child Care Benefit Membership Number","Kindergeld Mitgliedsnummer" +"Education Card Membership Number","Bildungskarte Mitgliedsnummer" +"Handicapped Pass Level of Care","Grad der Behinderung im Ausweis" +"Handicapped Person","Schwerbehinderten Ausweis" +"Health Insurance","Krankenkasse" +"Level of Care","Pflegegrad nach SGB XI §15" +"Membership Number","Mitgliedsnummer" +"Membership Numbers","Mitgliedsnummern" +"Personal Information","Persöhnlich" +"Preschool Reduction Membership Number","Kindergartenermäßigung Mitgliedsnummer" +"Social Institution Membership Number","Sozialzentrum Mitgliedsnummer" +"social institution","Sozialzentrum" \ No newline at end of file diff --git a/supportive_help/translations/en.csv b/supportive_help/translations/en.csv index 725a244..d7b6b9c 100644 --- a/supportive_help/translations/en.csv +++ b/supportive_help/translations/en.csv @@ -1,2 +1,4 @@ -"source_string","translated_string","context" -"sh_person","Person","table name" \ No newline at end of file +"source_string","translated_string" +"sh_person","Person" +"sh_residence","Residence" +"sh_person_counterpart","Counterpart" \ No newline at end of file -- cgit v1.2.3