-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from navariltd/ft-property-doctype
feat: Property Doctype
- Loading branch information
Showing
11 changed files
with
257 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
9 changes: 9 additions & 0 deletions
9
utility_billing/utility_billing/doctype/utility_category/test_utility_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2024, Navari and Contributors | ||
# See license.txt | ||
|
||
# import frappe | ||
from frappe.tests.utils import FrappeTestCase | ||
|
||
|
||
class TestUtilityCategory(FrappeTestCase): | ||
pass |
8 changes: 8 additions & 0 deletions
8
utility_billing/utility_billing/doctype/utility_category/utility_category.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2024, Navari and contributors | ||
// For license information, please see license.txt | ||
|
||
// frappe.ui.form.on("Utility Category", { | ||
// refresh(frm) { | ||
|
||
// }, | ||
// }); |
44 changes: 44 additions & 0 deletions
44
utility_billing/utility_billing/doctype/utility_category/utility_category.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"autoname": "field:title", | ||
"creation": "2024-11-06 16:06:42.742911", | ||
"doctype": "DocType", | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"title" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "title", | ||
"fieldtype": "Data", | ||
"label": "Title", | ||
"unique": 1 | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"links": [], | ||
"modified": "2024-11-06 16:06:42.742911", | ||
"modified_by": "Administrator", | ||
"module": "Utility Billing", | ||
"name": "Utility Category", | ||
"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 | ||
} | ||
], | ||
"sort_field": "creation", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
9 changes: 9 additions & 0 deletions
9
utility_billing/utility_billing/doctype/utility_category/utility_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2024, Navari and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class UtilityCategory(Document): | ||
pass |
Empty file.
9 changes: 9 additions & 0 deletions
9
utility_billing/utility_billing/doctype/utility_property/test_utility_property.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2024, Navari and Contributors | ||
# See license.txt | ||
|
||
# import frappe | ||
from frappe.tests.utils import FrappeTestCase | ||
|
||
|
||
class TestUtilityProperty(FrappeTestCase): | ||
pass |
12 changes: 12 additions & 0 deletions
12
utility_billing/utility_billing/doctype/utility_property/utility_property.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) 2024, Navari and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on("Utility Property", { | ||
refresh(frm) { | ||
frm.toggle_display("address_html", !frm.is_new()); | ||
frm.toggle_display("contact_html", !frm.is_new()); | ||
if (!frm.is_new()) { | ||
frappe.contacts.render_address_and_contact(frm); | ||
} | ||
}, | ||
}); |
154 changes: 154 additions & 0 deletions
154
utility_billing/utility_billing/doctype/utility_property/utility_property.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"autoname": "field:property_name", | ||
"creation": "2024-11-06 15:58:52.896790", | ||
"doctype": "DocType", | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"section_break_uwso", | ||
"property_name", | ||
"territory", | ||
"utility_category", | ||
"location", | ||
"parent_utility_property", | ||
"is_group", | ||
"column_break_dhhw", | ||
"lft", | ||
"plot_no", | ||
"house_no", | ||
"rgt", | ||
"old_parent", | ||
"address_contacts_tab", | ||
"address_html", | ||
"column_break_txlm", | ||
"contact_html" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "section_break_uwso", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "lft", | ||
"fieldtype": "Int", | ||
"hidden": 1, | ||
"label": "Left", | ||
"no_copy": 1, | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "rgt", | ||
"fieldtype": "Int", | ||
"hidden": 1, | ||
"label": "Right", | ||
"no_copy": 1, | ||
"read_only": 1 | ||
}, | ||
{ | ||
"default": "0", | ||
"fieldname": "is_group", | ||
"fieldtype": "Check", | ||
"label": "Is Group" | ||
}, | ||
{ | ||
"fieldname": "old_parent", | ||
"fieldtype": "Link", | ||
"label": "Old Parent", | ||
"options": "Utility Property" | ||
}, | ||
{ | ||
"fieldname": "parent_utility_property", | ||
"fieldtype": "Link", | ||
"ignore_user_permissions": 1, | ||
"label": "Parent Utility Property", | ||
"options": "Utility Property" | ||
}, | ||
{ | ||
"fieldname": "property_name", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Name", | ||
"reqd": 1, | ||
"unique": 1 | ||
}, | ||
{ | ||
"fieldname": "column_break_dhhw", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fieldname": "territory", | ||
"fieldtype": "Link", | ||
"label": "Territory", | ||
"options": "Territory" | ||
}, | ||
{ | ||
"fieldname": "utility_category", | ||
"fieldtype": "Link", | ||
"label": "Utility Category", | ||
"options": "Utility Category" | ||
}, | ||
{ | ||
"fieldname": "location", | ||
"fieldtype": "Link", | ||
"label": "Location", | ||
"options": "Location" | ||
}, | ||
{ | ||
"fieldname": "plot_no", | ||
"fieldtype": "Data", | ||
"label": "Plot No" | ||
}, | ||
{ | ||
"fieldname": "house_no", | ||
"fieldtype": "Data", | ||
"label": "House No" | ||
}, | ||
{ | ||
"fieldname": "address_contacts_tab", | ||
"fieldtype": "Tab Break", | ||
"label": "Address & Contacts" | ||
}, | ||
{ | ||
"fieldname": "address_html", | ||
"fieldtype": "HTML", | ||
"label": "Address HTML" | ||
}, | ||
{ | ||
"fieldname": "column_break_txlm", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fieldname": "contact_html", | ||
"fieldtype": "HTML", | ||
"label": "Contact HTML" | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"is_tree": 1, | ||
"links": [], | ||
"modified": "2024-11-06 16:19:19.100357", | ||
"modified_by": "Administrator", | ||
"module": "Utility Billing", | ||
"name": "Utility Property", | ||
"naming_rule": "By fieldname", | ||
"nsm_parent_field": "parent_utility_property", | ||
"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": [] | ||
} |
11 changes: 11 additions & 0 deletions
11
utility_billing/utility_billing/doctype/utility_property/utility_property.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) 2024, Navari and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
from frappe.utils.nestedset import NestedSet | ||
from frappe.contacts.address_and_contact import load_address_and_contact | ||
|
||
|
||
class UtilityProperty(NestedSet): | ||
def onload(self): | ||
load_address_and_contact(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters