Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Award Type doctype (LAN-793) #250

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions landa/organization_management/doctype/award/award.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
{
"allow_in_quick_entry": 1,
"fieldname": "award_type",
"fieldtype": "Select",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Award Type",
"options": "\nGoldene \u00c4sche\nEhrennadel Bronze\nEhrennadel Silber\nEhrennadel Gold\nEhrennadel VGA Bronze\nEhrennadel VGA Silber\nEhrennadel VGA Gold\nJugendmedaille\nHegemedaille\nEhrenurkunde",
"options": "Award Type",
"reqd": 1
},
{
Expand Down Expand Up @@ -94,7 +94,7 @@
}
],
"links": [],
"modified": "2022-12-16 14:50:53.483388",
"modified": "2023-11-16 19:11:54.888522",
"modified_by": "Administrator",
"module": "Organization Management",
"name": "Award",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2023, ALYF GmbH and contributors
// For license information, please see license.txt

frappe.ui.form.on('Award Type', {
// refresh: function(frm) {

// }
});
70 changes: 70 additions & 0 deletions landa/organization_management/doctype/award_type/award_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"actions": [],
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:award_type",
"creation": "2023-11-16 19:01:26.014892",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"award_type"
],
"fields": [
{
"fieldname": "award_type",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Award Type",
"reqd": 1,
"unique": 1
}
],
"links": [],
"modified": "2023-11-16 19:07:58.423095",
"modified_by": "Administrator",
"module": "Organization Management",
"name": "Award Type",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 1,
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "LANDA State Organization Employee",
"set_user_permissions": 1,
"share": 1,
"write": 1
},
{
"read": 1,
"report": 1,
"role": "LANDA Regional Organization Management"
},
{
"read": 1,
"role": "LANDA Member"
}
],
"sort_field": "modified",
"sort_order": "DESC"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023, ALYF GmbH and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class AwardType(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023, ALYF GmbH and Contributors
# See license.txt

# import frappe
import unittest


class TestAwardType(unittest.TestCase):
pass
1 change: 1 addition & 0 deletions landa/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ landa.patches.cleanup_addresses_and_contacts
landa.patches.lease_rent_per_year
landa.patches.add_water_body_title_in_stocking
landa.patches.multi_to_polygon
landa.patches.add_award_types
35 changes: 35 additions & 0 deletions landa/patches/add_award_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import frappe


def execute():
add_award_typyes()


def add_award_typyes():
frappe.reload_doc("organization_management", "doctype", "award_type")
frappe.reload_doc("organization_management", "doctype", "award")
award_types = [
barredterra marked this conversation as resolved.
Show resolved Hide resolved
"Goldene Äsche",
"Ehrennadel Bronze",
"Ehrennadel Silber",
"Ehrennadel Gold",
"Ehrennadel VGA Bronze",
"Ehrennadel VGA Silber",
"Ehrennadel VGA Gold",
"Jugendmedaille",
"Hegemedaille",
"Ehrenurkunde",
"Ehrenplakette",
"Ehrenspange",
"Ehrenpokal",
]

for award_type in award_types:
if not frappe.db.exists("Award Type", award_type):
doc = frappe.get_doc(
{
"doctype": "Award Type",
"award_type": award_type,
}
)
doc.insert()
Loading