Skip to content

Commit

Permalink
fix: customer creation on submit utility service request
Browse files Browse the repository at this point in the history
  • Loading branch information
muruthigitau committed Oct 14, 2024
1 parent 599ff95 commit 0302f60
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 18 deletions.
72 changes: 64 additions & 8 deletions utility_billing/fixtures/custom_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"dt": "BOM",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "utility_request",
"fieldname": "utility_service_request",
"fieldtype": "Link",
"hidden": 0,
"hide_border": 0,
Expand All @@ -85,16 +85,16 @@
"insert_after": "quantity",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Utility Request",
"label": "Utility Service Request",
"length": 0,
"link_filters": null,
"mandatory_depends_on": null,
"modified": "2024-10-09 09:02:27.078449",
"modified": "2024-10-14 05:49:24.195096",
"module": "Utility Billing",
"name": "BOM-custom_utility_request",
"no_copy": 0,
"non_negative": 0,
"options": "Request for Utility Service",
"options": "Utility Service Request",
"permlevel": 0,
"precision": "",
"print_hide": 0,
Expand Down Expand Up @@ -223,6 +223,62 @@
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"default": null,
"depends_on": null,
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "Customer",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "nrc_or_passport_no",
"fieldtype": "Data",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "customer_group",
"is_system_generated": 0,
"is_virtual": 0,
"label": "NRC or Passport No",
"length": 0,
"link_filters": null,
"mandatory_depends_on": null,
"modified": "2024-10-14 05:53:37.647063",
"module": "Utility Billing",
"name": "Customer-custom_nrc_or_passport_no",
"no_copy": 0,
"non_negative": 0,
"options": null,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
"read_only_depends_on": null,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
Expand Down Expand Up @@ -350,7 +406,7 @@
"dt": "Issue",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "request_for_utility_service",
"fieldname": "utility_service_request",
"fieldtype": "Link",
"hidden": 0,
"hide_border": 0,
Expand All @@ -365,16 +421,16 @@
"insert_after": "email_account",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Utility Request",
"label": "Utility Service Request",
"length": 0,
"link_filters": null,
"mandatory_depends_on": null,
"modified": "2024-10-09 09:15:25.004686",
"modified": "2024-10-14 05:31:21.910805",
"module": "Utility Billing",
"name": "Issue-custom_request_for_utility_service",
"no_copy": 0,
"non_negative": 0,
"options": "Request for Utility Service",
"options": "Utility Service Request",
"permlevel": 0,
"precision": "",
"print_hide": 0,
Expand Down
5 changes: 3 additions & 2 deletions utility_billing/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"dt",
"in",
(
"BOM",
"Customer",
"Issue",
"Item Price",
"Sales Order Item",
"Sales Invoice Item",
"Issue",
"BOM",
),
],
["is_system_generated", "=", 0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"column_break_nqzi",
"date",
"request_type",
"nrcpassport_no",
"territory",
"column_break_wxld",
"company",
"tax_id",
"nrcpassport_no",
"section_break_lpoa",
"connection_size",
"pipes_typedistance",
Expand Down Expand Up @@ -92,7 +92,8 @@
"in_list_view": 1,
"in_preview": 1,
"in_standard_filter": 1,
"label": "Name"
"label": "Name",
"reqd": 1
},
{
"fieldname": "customer_type",
Expand All @@ -109,8 +110,9 @@
},
{
"fieldname": "territory",
"fieldtype": "Data",
"label": "Territory"
"fieldtype": "Link",
"label": "Territory",
"options": "Territory"
},
{
"fieldname": "column_break_nqzi",
Expand Down Expand Up @@ -233,7 +235,7 @@
"fieldtype": "Data",
"in_filter": 1,
"in_standard_filter": 1,
"label": "Organisation Registration No"
"label": "Tax ID"
},
{
"fieldname": "section_break_jqrx",
Expand Down Expand Up @@ -261,7 +263,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-10-14 01:52:46.346069",
"modified": "2024-10-14 05:12:30.780832",
"modified_by": "Administrator",
"module": "Utility Billing",
"name": "Utility Service Request",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def on_submit(self):
"customer_type": self.customer_type,
"customer_group": self.customer_group,
"territory": self.territory,
"nrcpassport_no": self.nrcpassport_no,
"organisation_registration_no": self.organisation_registration_no,
"tax_id": self.tax_id,
"nrc_or_passport_no": self.nrcpassport_no,
"company": self.company,
}
)
customer.insert()

0 comments on commit 0302f60

Please sign in to comment.