From fb5a6122a41a92d81f46bf30d4d7ac52ba0adfda Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Tue, 28 Oct 2025 12:39:33 -0400 Subject: [PATCH] Added warehouses for Receiving Statuses to track inventory. --- uberleben_custom/fixtures/client_script.json | 6 +- uberleben_custom/fixtures/warehouse.json | 290 +++++++++++++++++++ uberleben_custom/hooks.py | 3 +- 3 files changed, 295 insertions(+), 4 deletions(-) create mode 100644 uberleben_custom/fixtures/warehouse.json diff --git a/uberleben_custom/fixtures/client_script.json b/uberleben_custom/fixtures/client_script.json index c193079..3062808 100644 --- a/uberleben_custom/fixtures/client_script.json +++ b/uberleben_custom/fixtures/client_script.json @@ -3,11 +3,11 @@ "docstatus": 0, "doctype": "Client Script", "dt": "Item", - "enabled": 1, - "modified": "2025-10-22 10:23:55.971497", + "enabled": 0, + "modified": "2025-10-28 11:00:56.882412", "module": "Uberleben Customizations", "name": "Update Stock Information", - "script": "frappe.listview_settings[\"Item\"] = frappe.listview_settings[\"Item\"] || {};\n\nfrappe.list_view_settings[\"Item\"].before_render = function() {\n console.log(\"Before Render function.\");\n}", + "script": "frappe.listview_settings[\"Item\"] = frappe.listview_settings[\"Item\"] || {};\n\nlet data;\n\nfrappe.listview_settings[\"Item\"].onload = async function() {\n await frappe.call({\n method: \"uberleben_custom.api.get_item_per_wh\",\n callback: function(r){\n console.log(r);\n if (r.message) {\n console.log(\"Got a message!\");\n console.log(r.message);\n data = r.message;\n }\n }\n });\n console.log(data);\n}\n\nfrappe.listview_settings[\"Item\"].button = {\n show(doc) {\n return doc.reference_name;\n },\n get_label() {\n return \"Stock Info\"\n },\n action() {\n frappe.msgprint(\"Info\")\n }\n}\n\nfrappe.listview_settings[\"Item\"].formatters = {\n custom_stock_information(value, subject_field, doc) {\n console.log(doc)\n let item = doc.name;\n let item_details = data[item];\n console.log(item);\n console.log(item_details);\n let result = \"\";\n Object.keys(item_details).forEach(wh => {\n let number = item_details[wh];\n //if (item_details[wh] != null) {\n // result += `${wh}: ${number}`;\n //}\n result += `${wh}: ${number}`;\n });\n return result;\n //return '' + result + '';\n }\n}", "view": "List" } ] \ No newline at end of file diff --git a/uberleben_custom/fixtures/warehouse.json b/uberleben_custom/fixtures/warehouse.json new file mode 100644 index 0000000..0350c1f --- /dev/null +++ b/uberleben_custom/fixtures/warehouse.json @@ -0,0 +1,290 @@ +[ + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-21 16:01:52.467069", + "name": "Stores - U", + "old_parent": "All Warehouses - U", + "parent_warehouse": "All Warehouses - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Stores", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:10:23.322030", + "name": "Work In Progress - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Work In Progress", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:10:12.196648", + "name": "Finished Goods - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Finished Goods", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-21 16:01:52.487226", + "name": "Goods In Transit - U", + "old_parent": "All Warehouses - U", + "parent_warehouse": "All Warehouses - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Goods In Transit", + "warehouse_type": "Transit" + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 1, + "mobile_no": null, + "modified": "2025-10-28 12:10:00.605806", + "name": "Damaged - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Damaged - U", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:09:54.087306", + "name": "Receiving - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Receiving - U", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:09:46.836850", + "name": "QC In Progress - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "QC In Progress - U", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:09:39.539332", + "name": "QC Hold - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "QC Hold - U", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:09:12.219956", + "name": "Staged - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Staged - U", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 0, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:08:58.548141", + "name": "Inbound - U", + "old_parent": "Uberleben HQ - U", + "parent_warehouse": "Uberleben HQ - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Inbound", + "warehouse_type": null + }, + { + "account": null, + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 1, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-21 16:01:52.458015", + "name": "All Warehouses - U", + "old_parent": "", + "parent_warehouse": null, + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "All Warehouses", + "warehouse_type": null + }, + { + "account": "Stock In Hand - U", + "address_line_1": null, + "address_line_2": null, + "city": null, + "company": "Uberleben", + "default_in_transit_warehouse": null, + "disabled": 0, + "docstatus": 0, + "doctype": "Warehouse", + "email_id": null, + "is_group": 1, + "is_rejected_warehouse": 0, + "mobile_no": null, + "modified": "2025-10-28 12:10:35.789593", + "name": "Uberleben HQ - U", + "old_parent": "All Warehouses - U", + "parent_warehouse": "All Warehouses - U", + "phone_no": null, + "pin": null, + "state": null, + "warehouse_name": "Uberleben HQ", + "warehouse_type": null + } +] \ No newline at end of file diff --git a/uberleben_custom/hooks.py b/uberleben_custom/hooks.py index 7f7223f..4ba7976 100644 --- a/uberleben_custom/hooks.py +++ b/uberleben_custom/hooks.py @@ -26,7 +26,8 @@ add_to_apps_screen = [ fixtures = [ {"doctype": "Client Script", "filters": [["module", "=", "Uberleben Customizations"]]}, - "Custom HTML Block" + "Custom HTML Block", + "Warehouse" ] # Includes in