From 39077d4210c50c885665d28add05ee22edadd16f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 20 Jul 2016 18:55:42 +0530 Subject: [PATCH] [dashboard] for quotation and sales order --- erpnext/portal/doctype/homepage/homepage.py | 5 +-- erpnext/public/js/utils/document_flow.js | 4 +-- .../doctype/quotation/quotation_dashboard.py | 11 +++++++ .../sales_order/sales_order_dashboard.py | 33 +++++++++++++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 erpnext/selling/doctype/quotation/quotation_dashboard.py create mode 100644 erpnext/selling/doctype/sales_order/sales_order_dashboard.py diff --git a/erpnext/portal/doctype/homepage/homepage.py b/erpnext/portal/doctype/homepage/homepage.py index a8172303dae..20ce7671891 100644 --- a/erpnext/portal/doctype/homepage/homepage.py +++ b/erpnext/portal/doctype/homepage/homepage.py @@ -17,9 +17,10 @@ class Homepage(Document): for d in frappe.get_all('Item', fields=['name', 'item_name', 'description', 'image'], filters={'show_in_website': 1}, limit=3): - # set missing routes (?) doc = frappe.get_doc('Item', d.name) - doc.save() + if not doc.route: + # set missing route + doc.save() self.append('products', dict(item_code=d.name, item_name=d.item_name, description=d.description, image=d.image)) diff --git a/erpnext/public/js/utils/document_flow.js b/erpnext/public/js/utils/document_flow.js index 0bc0b44aaf0..c20a4b79aeb 100644 --- a/erpnext/public/js/utils/document_flow.js +++ b/erpnext/public/js/utils/document_flow.js @@ -5,8 +5,8 @@ $.extend(frappe.document_flow, { "Selling": { - "Sales Order": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"], - "Quotation": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"] + // "Sales Order": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"], + // "Quotation": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"] }, "Accounts": { "Sales Invoice": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"], diff --git a/erpnext/selling/doctype/quotation/quotation_dashboard.py b/erpnext/selling/doctype/quotation/quotation_dashboard.py new file mode 100644 index 00000000000..80dc6aa4224 --- /dev/null +++ b/erpnext/selling/doctype/quotation/quotation_dashboard.py @@ -0,0 +1,11 @@ +from frappe import _ + +data = { + 'fieldname': 'prevdoc_docname', + 'transactions': [ + { + 'label': _('Related'), + 'items': ['Sales Order'] + }, + ] +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py new file mode 100644 index 00000000000..feda39d33c2 --- /dev/null +++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py @@ -0,0 +1,33 @@ +from frappe import _ + +data = { + 'fieldname': 'sales_order', + 'non_standard_fieldnames': { + 'Delivery Note': 'against_sales_order', + }, + 'internal_links': { + 'Quotation': ['items', 'prevdoc_docname'] + }, + 'transactions': [ + { + 'label': _('Fulfillment'), + 'items': ['Sales Invoice', 'Delivery Note'] + }, + { + 'label': _('Purchasing'), + 'items': ['Material Request', 'Purchase Order'] + }, + { + 'label': _('Projects'), + 'items': ['Project'] + }, + { + 'label': _('Manufacturing'), + 'items': ['Production Order'] + }, + { + 'label': _('Reference'), + 'items': ['Quotation'] + }, + ] +} \ No newline at end of file