[cleanup] document flow
This commit is contained in:
parent
a8217dc7e9
commit
16e2442278
@ -26,10 +26,9 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
this._super();
|
||||
|
||||
hide_fields(this.frm.doc);
|
||||
this.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();
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
|
||||
refresh: function(doc, dt, dn) {
|
||||
this._super();
|
||||
this.frm.page.add_document_flow(this.frm)
|
||||
if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
|
||||
// hide new msgbox
|
||||
cur_frm.msgbox.hide();
|
||||
|
@ -20,7 +20,6 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
||||
// this.frm.dashboard.reset();
|
||||
var allow_receipt = false;
|
||||
var is_drop_ship = false;
|
||||
this.frm.page.add_document_flow(this.frm)
|
||||
for (var i in cur_frm.doc.items) {
|
||||
var item = cur_frm.doc.items[i];
|
||||
if(item.delivered_by_supplier !== 1) {
|
||||
|
@ -7,7 +7,6 @@
|
||||
erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.extend({
|
||||
refresh: function() {
|
||||
this._super();
|
||||
this.frm.page.add_document_flow(this.frm);
|
||||
if (this.frm.doc.docstatus === 1) {
|
||||
cur_frm.add_custom_button(__("Purchase Order"), this.make_purchase_order,
|
||||
__("Make"));
|
||||
|
@ -27,7 +27,7 @@
|
||||
"public/js/payment/payment_details.html",
|
||||
"public/js/templates/item_selector.html",
|
||||
"public/js/utils/item_selector.js",
|
||||
"public/js/module_flow.js"
|
||||
"public/js/utils/document_flow.js"
|
||||
],
|
||||
"js/item-dashboard.min.js": [
|
||||
"stock/dashboard/item_dashboard.html",
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
// for module flow
|
||||
|
||||
|
||||
frappe.module_flow = {
|
||||
frappe.provide('frappe.document_flow');
|
||||
$.extend(frappe.document_flow, {
|
||||
"Selling": {
|
||||
"Sales Order": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Journal Entry"],
|
||||
"Quotation": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Journal Entry"]
|
||||
@ -25,4 +25,4 @@ frappe.module_flow = {
|
||||
"Purchase Receipt": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
|
||||
"Purchase Invoice", "Journal Entry"]
|
||||
}
|
||||
}
|
||||
});
|
@ -16,7 +16,6 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
||||
},
|
||||
refresh: function(doc, dt, dn) {
|
||||
this._super(doc, dt, dn);
|
||||
this.frm.page.add_document_flow(this.frm)
|
||||
if(doc.docstatus == 1 && doc.status!=='Lost') {
|
||||
cur_frm.add_custom_button(__('Make Sales Order'),
|
||||
cur_frm.cscript['Make Sales Order']);
|
||||
|
@ -22,7 +22,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
||||
var allow_purchase = false;
|
||||
var allow_delivery = false;
|
||||
|
||||
this.frm.page.add_document_flow(this.frm)
|
||||
if(doc.docstatus==1) {
|
||||
if(doc.status != 'Closed') {
|
||||
|
||||
|
@ -8,7 +8,6 @@ frappe.provide("erpnext.stock.delivery_note");
|
||||
erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({
|
||||
refresh: function(doc, dt, dn) {
|
||||
this._super();
|
||||
this.frm.page.add_document_flow(this.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"));
|
||||
|
@ -29,7 +29,7 @@ frappe.ui.form.on("Purchase Receipt", {
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
frm.set_query("supplier_warehouse", function() {
|
||||
return {
|
||||
filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]]
|
||||
@ -41,7 +41,6 @@ frappe.ui.form.on("Purchase Receipt", {
|
||||
erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend({
|
||||
refresh: function() {
|
||||
this._super();
|
||||
this.frm.page.add_document_flow(this.frm)
|
||||
if(this.frm.doc.docstatus===1) {
|
||||
this.show_stock_ledger();
|
||||
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
|
||||
@ -71,9 +70,9 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
||||
if (this.frm.has_perm("submit")) {
|
||||
cur_frm.add_custom_button(__("Close"), this.close_purchase_receipt, __("Status"))
|
||||
}
|
||||
|
||||
|
||||
cur_frm.add_custom_button(__('Return'), this.make_purchase_return, __("Make"));
|
||||
|
||||
|
||||
if(flt(this.frm.doc.per_billed) < 100) {
|
||||
cur_frm.add_custom_button(__('Invoice'), this.make_purchase_invoice, __("Make"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user