Skip to content

Commit

Permalink
Merge pull request #25 from navariltd/ft-property-doctype
Browse files Browse the repository at this point in the history
feat: Property Doctype
  • Loading branch information
muruthigitau authored Nov 6, 2024
2 parents d8b0b11 + c3e9b30 commit c22cd7d
Show file tree
Hide file tree
Showing 11 changed files with 257 additions and 1 deletion.
Empty file.
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
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) {

// },
// });
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": []
}
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.
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
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);
}
},
});
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": []
}
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)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class UtilityServiceRequest(Document):
def onload(self):
load_address_and_contact(self)


@frappe.whitelist()
def create_customer_and_sales_order(docname):
Expand Down

0 comments on commit c22cd7d

Please sign in to comment.