diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index b634ccf2664..5e27b6016b4 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -26,10 +26,10 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ this._super(); hide_fields(this.frm.doc); - + cur_frm.page.add_document_flow(cur_frm) // Show / Hide button this.show_general_ledger(); - + if(doc.update_stock==1 && doc.docstatus==1) { this.show_stock_ledger(); } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index cc6d1e66479..6ec07c588ea 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -24,7 +24,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte refresh: function(doc, dt, dn) { this._super(); - + cur_frm.page.add_document_flow(cur_frm) if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) { // hide new msgbox cur_frm.msgbox.hide(); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index ddaa5b4e56d..1025ab981ee 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -20,7 +20,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( // this.frm.dashboard.reset(); var allow_receipt = false; var is_drop_ship = false; - + cur_frm.page.add_document_flow(cur_frm) for (var i in cur_frm.doc.items) { var item = cur_frm.doc.items[i]; if(item.delivered_by_supplier !== 1) { diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index 8587a9fdd7b..c24cab984b5 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -7,7 +7,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.extend({ refresh: function() { this._super(); - + cur_frm.page.add_document_flow(cur_frm); if (this.frm.doc.docstatus === 1) { cur_frm.add_custom_button(__("Purchase Order"), this.make_purchase_order, __("Make")); diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 9e5283cfb8a..c31c919d6af 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -16,7 +16,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ }, refresh: function(doc, dt, dn) { this._super(doc, dt, dn); - + cur_frm.page.add_document_flow(cur_frm) if(doc.docstatus == 1 && doc.status!=='Lost') { cur_frm.add_custom_button(__('Make Sales Order'), cur_frm.cscript['Make Sales Order']); diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 29501f5973d..d4e36c7cbc8 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -21,7 +21,8 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( this.frm.dashboard.reset(); var allow_purchase = false; var allow_delivery = false; - + + cur_frm.page.add_document_flow(cur_frm) if(doc.docstatus==1) { if(doc.status != 'Closed') { diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 7bdcb0aa9cf..8ec5bfad0ce 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -32,6 +32,30 @@ def boot_session(bootinfo): bootinfo.docs += frappe.db.sql("""select name, default_currency, cost_center, default_terms, default_letter_head, default_bank_account from `tabCompany`""", as_dict=1, update={"doctype":":Company"}) + + bootinfo.module_flow = { + "Selling": { + "Sales Order": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Journal Entry"], + "Quotation": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Journal Entry"] + }, + "Accounts": { + "Sales Invoice": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Journal Entry"], + "Purchase Invoice": ["Supplier Quotation", "Purchase Order", "Purchase Receipt", + "Purchase Invoice", "Journal Entry"] + }, + "Buying": { + "Purchase Order": ["Supplier Quotation", "Purchase Order", "Purchase Receipt", + "Purchase Invoice", "Journal Entry"], + "Supplier Quotation": ["Supplier Quotation", "Purchase Order", "Purchase Receipt", + "Purchase Invoice", "Journal Entry"] + }, + "Stock": { + "Delivery Note": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Journal Entry"], + "Purchase Receipt": ["Supplier Quotation", "Purchase Order", "Purchase Receipt", + "Purchase Invoice", "Journal Entry"] + } + } + def load_country_and_currency(bootinfo): country = frappe.db.get_default("country") diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 6d3138667a8..45cb7c1e80a 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -8,7 +8,7 @@ frappe.provide("erpnext.stock.delivery_note"); erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({ refresh: function(doc, dt, dn) { this._super(); - + cur_frm.page.add_document_flow(cur_frm) if (!doc.is_return && doc.status!="Closed") { if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1) cur_frm.add_custom_button(__('Installation Note'), this.make_installation_note, __("Make")); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index a967b5b345b..faf579d2f1f 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -41,7 +41,7 @@ frappe.ui.form.on("Purchase Receipt", { erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend({ refresh: function() { this._super(); - + cur_frm.page.add_document_flow(cur_frm) if(this.frm.doc.docstatus===1) { this.show_stock_ledger(); if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {