From 830f2b642bcaa7fd82f60b598d1a26a096523a4b Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Fri, 5 Jul 2019 09:48:38 +0530 Subject: [PATCH 1/2] chore(manufacturing): added dashboard for doctypes --- .../blanket_order/blanket_order_dashboard.py | 12 +++++++++ .../doctype/bom/bom_dashboard.py | 27 +++++++++++++++++++ .../doctype/operation/operation_dashboard.py | 13 +++++++++ .../doctype/routing/routing_dashboard.py | 12 +++++++++ .../workstation/workstation_dashboard.py | 13 +++++++++ erpnext/stock/doctype/item/item_dashboard.py | 2 +- 6 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py create mode 100644 erpnext/manufacturing/doctype/bom/bom_dashboard.py create mode 100644 erpnext/manufacturing/doctype/operation/operation_dashboard.py create mode 100644 erpnext/manufacturing/doctype/routing/routing_dashboard.py create mode 100644 erpnext/manufacturing/doctype/workstation/workstation_dashboard.py diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py new file mode 100644 index 00000000000..0005439cb1a --- /dev/null +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'blanket_order', + 'transactions': [ + { + 'items': ['Purchase Order', 'Sales Order'] + } + ] + } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom/bom_dashboard.py b/erpnext/manufacturing/doctype/bom/bom_dashboard.py new file mode 100644 index 00000000000..af710b04644 --- /dev/null +++ b/erpnext/manufacturing/doctype/bom/bom_dashboard.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'bom_no', + 'non_standard_fieldnames': { + 'Item': 'default_bom', + 'Purchase Order': 'bom', + 'Purchase Receipt': 'bom', + 'Purchase Invoice': 'bom' + }, + 'transactions': [ + { + 'label': _('Stock'), + 'items': ['Item', 'Stock Entry', 'Quality Inspection'] + }, + { + 'label': _('Manufacture'), + 'items': ['BOM', 'Work Order', 'Job Card', 'Production Plan'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] + } + ] + } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/operation/operation_dashboard.py b/erpnext/manufacturing/doctype/operation/operation_dashboard.py new file mode 100644 index 00000000000..9e53a20ad58 --- /dev/null +++ b/erpnext/manufacturing/doctype/operation/operation_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'operation', + 'transactions': [ + { + 'label': _('Manufacture'), + 'items': ['BOM', 'Work Order', 'Job Card', 'Timesheet'] + } + ] + } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/routing/routing_dashboard.py b/erpnext/manufacturing/doctype/routing/routing_dashboard.py new file mode 100644 index 00000000000..ab309cc9d50 --- /dev/null +++ b/erpnext/manufacturing/doctype/routing/routing_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'routing', + 'transactions': [ + { + 'items': ['BOM'] + } + ] + } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py new file mode 100644 index 00000000000..c5683134f21 --- /dev/null +++ b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'workstation', + 'transactions': [ + { + 'label': _('Manufacture'), + 'items': ['BOM', 'Routing', 'Work Order', 'Job Card', 'Operation', 'Timesheet'] + } + ] + } \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py index b3733d357ba..4bf3c38e222 100644 --- a/erpnext/stock/doctype/item/item_dashboard.py +++ b/erpnext/stock/doctype/item/item_dashboard.py @@ -41,7 +41,7 @@ def get_data(): }, { 'label': _('Manufacture'), - 'items': ['Work Order', 'Item Manufacturer'] + 'items': ['Production Plan', 'Work Order', 'Item Manufacturer'] } ] } \ No newline at end of file From ad33c195100abfd35fd1d5ed16998c8ac1a3563b Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Fri, 5 Jul 2019 11:28:59 +0530 Subject: [PATCH 2/2] fix: converting spaces to tabs on a few lines --- .../doctype/blanket_order/blanket_order_dashboard.py | 2 +- erpnext/manufacturing/doctype/bom/bom_dashboard.py | 10 +++++----- .../doctype/job_card/job_card_dashboard.py | 2 +- .../doctype/operation/operation_dashboard.py | 2 +- .../doctype/workstation/workstation_dashboard.py | 2 +- erpnext/stock/doctype/item/item_dashboard.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py index 0005439cb1a..ed319a0cefd 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py @@ -9,4 +9,4 @@ def get_data(): 'items': ['Purchase Order', 'Sales Order'] } ] - } \ No newline at end of file + } diff --git a/erpnext/manufacturing/doctype/bom/bom_dashboard.py b/erpnext/manufacturing/doctype/bom/bom_dashboard.py index af710b04644..803ece7c789 100644 --- a/erpnext/manufacturing/doctype/bom/bom_dashboard.py +++ b/erpnext/manufacturing/doctype/bom/bom_dashboard.py @@ -6,9 +6,9 @@ def get_data(): 'fieldname': 'bom_no', 'non_standard_fieldnames': { 'Item': 'default_bom', - 'Purchase Order': 'bom', - 'Purchase Receipt': 'bom', - 'Purchase Invoice': 'bom' + 'Purchase Order': 'bom', + 'Purchase Receipt': 'bom', + 'Purchase Invoice': 'bom' }, 'transactions': [ { @@ -19,9 +19,9 @@ def get_data(): 'label': _('Manufacture'), 'items': ['BOM', 'Work Order', 'Job Card', 'Production Plan'] }, - { + { 'label': _('Purchase'), 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] } ] - } \ No newline at end of file + } diff --git a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py index d48bccf9d42..c2aa2bd968a 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py +++ b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py @@ -10,4 +10,4 @@ def get_data(): 'items': ['Material Request', 'Stock Entry'] } ] - } \ No newline at end of file + } diff --git a/erpnext/manufacturing/doctype/operation/operation_dashboard.py b/erpnext/manufacturing/doctype/operation/operation_dashboard.py index 9e53a20ad58..8deb9ec6e0b 100644 --- a/erpnext/manufacturing/doctype/operation/operation_dashboard.py +++ b/erpnext/manufacturing/doctype/operation/operation_dashboard.py @@ -10,4 +10,4 @@ def get_data(): 'items': ['BOM', 'Work Order', 'Job Card', 'Timesheet'] } ] - } \ No newline at end of file + } diff --git a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py index c5683134f21..9e0d1d17394 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py +++ b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py @@ -10,4 +10,4 @@ def get_data(): 'items': ['BOM', 'Routing', 'Work Order', 'Job Card', 'Operation', 'Timesheet'] } ] - } \ No newline at end of file + } diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py index 4bf3c38e222..dd4676a037a 100644 --- a/erpnext/stock/doctype/item/item_dashboard.py +++ b/erpnext/stock/doctype/item/item_dashboard.py @@ -44,4 +44,4 @@ def get_data(): 'items': ['Production Plan', 'Work Order', 'Item Manufacturer'] } ] - } \ No newline at end of file + }