From 2017fd80d1bf930fd5185ddb3ddb427eb73841f8 Mon Sep 17 00:00:00 2001 From: CaseSolved Date: Wed, 25 Sep 2024 19:09:05 +0100 Subject: [PATCH 1/2] fix: SO link on PO and add in missing dashboard references on both --- .../purchase_order_dashboard.py | 21 +++++++++++++++---- .../sales_order/sales_order_dashboard.py | 4 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index 36fe079fc98d..6ae50e714160 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -14,18 +14,31 @@ def get_data(): "Material Request": ["items", "material_request"], "Supplier Quotation": ["items", "supplier_quotation"], "Project": ["items", "project"], + "Sales Order": ["items", "sales_order"], + "BOM": ["items", "bom"], + "Production Plan": ["items", "production_plan"], + "Blanket Order": ["items", "blanket_order"], }, "transactions": [ - {"label": _("Related"), "items": ["Purchase Receipt", "Purchase Invoice"]}, - {"label": _("Payment"), "items": ["Payment Entry", "Journal Entry", "Payment Request"]}, + { + "label": _("Related"), + "items": ["Purchase Receipt", "Purchase Invoice", "Sales Order"] + }, + { + "label": _("Payment"), + "items": ["Payment Entry", "Journal Entry", "Payment Request"] + }, { "label": _("Reference"), - "items": ["Material Request", "Supplier Quotation", "Project", "Auto Repeat"], + "items": ["Supplier Quotation", "Project", "Auto Repeat"], + }, + { + "label": _("Manufacturing"), + "items": ["Material Request", "BOM", "Production Plan", "Blanket Order"], }, { "label": _("Sub-contracting"), "items": ["Subcontracting Order", "Subcontracting Receipt", "Stock Entry"], }, - {"label": _("Internal"), "items": ["Sales Order"]}, ], } diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py index c84009725b80..7c1c0deb33f0 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py @@ -15,6 +15,8 @@ def get_data(): }, "internal_links": { "Quotation": ["items", "prevdoc_docname"], + "BOM": ["items", "bom_no"], + "Blanket Order": ["items", "blanket_order"], }, "transactions": [ { @@ -23,7 +25,7 @@ def get_data(): }, {"label": _("Purchasing"), "items": ["Material Request", "Purchase Order"]}, {"label": _("Projects"), "items": ["Project"]}, - {"label": _("Manufacturing"), "items": ["Work Order"]}, + {"label": _("Manufacturing"), "items": ["Work Order", "BOM", "Blanket Order"]}, {"label": _("Reference"), "items": ["Quotation", "Auto Repeat", "Stock Reservation Entry"]}, {"label": _("Payment"), "items": ["Payment Entry", "Payment Request", "Journal Entry"]}, ], From be6970c850d3c81f1b32ae00ede2e49c588ab2e9 Mon Sep 17 00:00:00 2001 From: CaseSolved Date: Wed, 25 Sep 2024 19:27:21 +0100 Subject: [PATCH 2/2] chore: linting --- .../doctype/purchase_order/purchase_order_dashboard.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index 6ae50e714160..3fb8b30f139d 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -20,14 +20,8 @@ def get_data(): "Blanket Order": ["items", "blanket_order"], }, "transactions": [ - { - "label": _("Related"), - "items": ["Purchase Receipt", "Purchase Invoice", "Sales Order"] - }, - { - "label": _("Payment"), - "items": ["Payment Entry", "Journal Entry", "Payment Request"] - }, + {"label": _("Related"), "items": ["Purchase Receipt", "Purchase Invoice", "Sales Order"]}, + {"label": _("Payment"), "items": ["Payment Entry", "Journal Entry", "Payment Request"]}, { "label": _("Reference"), "items": ["Supplier Quotation", "Project", "Auto Repeat"],