Skip to content

Commit

Permalink
feat: Contact & Address - Request for Utility Service
Browse files Browse the repository at this point in the history
  • Loading branch information
muruthigitau committed Oct 9, 2024
1 parent 80e5b60 commit 4b0408b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2024, Navari and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Request for Utility Service", {
// refresh(frm) {

// },
// });
frappe.ui.form.on("Request for Utility Service", {
refresh: function (frm) {
frm.toggle_display("address_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
Expand Up @@ -28,16 +28,9 @@
"section_break_asmx",
"amended_from",
"address_and_contacts_tab",
"address",
"town",
"residential_area",
"street_name",
"plothouse_no",
"address_html",
"column_break_kzdt",
"contact",
"postal_address",
"telephonecell_no",
"email_address",
"contact_html",
"section_break_lpoa",
"connection_size",
"water_network",
Expand Down Expand Up @@ -163,24 +156,12 @@
{
"fieldname": "address_and_contacts_tab",
"fieldtype": "Tab Break",
"label": "Address and Contacts"
},
{
"fieldname": "address",
"fieldtype": "Link",
"label": "Address",
"options": "Address"
"label": "Address & Contacts"
},
{
"fieldname": "column_break_kzdt",
"fieldtype": "Column Break"
},
{
"fieldname": "contact",
"fieldtype": "Link",
"label": "Contact",
"options": "Contact"
},
{
"fieldname": "section_break_lpoa",
"fieldtype": "Section Break"
Expand Down Expand Up @@ -211,45 +192,22 @@
"label": "Pipes type/Distance"
},
{
"fieldname": "town",
"fieldtype": "Data",
"label": "Town"
},
{
"fieldname": "residential_area",
"fieldtype": "Data",
"label": "Residential Area"
},
{
"fieldname": "street_name",
"fieldtype": "Data",
"label": "Street Name"
},
{
"fieldname": "plothouse_no",
"fieldtype": "Data",
"label": "Plot/House no"
},
{
"fieldname": "postal_address",
"fieldtype": "Data",
"label": "Postal Address"
},
{
"fieldname": "telephonecell_no",
"fieldtype": "Data",
"label": "Telephone/Cell no"
"fieldname": "address_html",
"fieldtype": "HTML",
"label": "Address HTML",
"options": "Address"
},
{
"fieldname": "email_address",
"fieldtype": "Data",
"label": "Email Address\t"
"fieldname": "contact_html",
"fieldtype": "HTML",
"label": "Contact",
"options": "Contact"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-10-09 08:31:10.144297",
"modified": "2024-10-09 15:32:10.619999",
"modified_by": "Administrator",
"module": "Utility Billing",
"name": "Request for Utility Service",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Copyright (c) 2024, Navari and contributors
# For license information, please see license.txt

from frappe.contacts.address_and_contact import load_address_and_contact

# import frappe
from frappe.model.document import Document


class RequestforUtilityService(Document):
pass
def onload(self):
load_address_and_contact(self)

0 comments on commit 4b0408b

Please sign in to comment.