diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 034880a211..bfb500c665 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 } // toggle to pos view if is_pos is 1 in user_defaults - if ((cint(frappe.defaults.get_user_defaults("is_pos"))===1 || this.frm.doc.is_pos)) { + if ((is_null(this.frm.doc.is_pos) && cint(frappe.defaults.get_user_default("is_pos"))===1) || this.frm.doc.is_pos) { if(this.frm.doc.__islocal && !this.frm.doc.amended_from && !this.frm.doc.customer) { this.frm.set_value("is_pos", 1); this.is_pos(function() { diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 27ee1521c8..2c372042ea 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -47,7 +47,6 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ }, refresh: function() { - this.frm.clear_custom_buttons(); erpnext.toggle_naming_series(); erpnext.hide_company(); this.show_item_wise_taxes(); diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js index 286ce3593c..ba9741b4f6 100644 --- a/erpnext/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -30,7 +30,6 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({ refresh: function() { var doc = this.frm.doc; erpnext.toggle_naming_series(); - this.frm.clear_custom_buttons(); if(!this.frm.doc.__islocal && this.frm.doc.__onload && !this.frm.doc.__onload.is_customer) { this.frm.add_custom_button(__("Create Customer"), this.create_customer); diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js index 4cc95ad59b..ce7c6ea273 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.js +++ b/erpnext/selling/doctype/opportunity/opportunity.js @@ -80,7 +80,6 @@ $.extend(cur_frm.cscript, new erpnext.selling.Opportunity({frm: cur_frm})); cur_frm.cscript.refresh = function(doc, cdt, cdn) { erpnext.toggle_naming_series(); - cur_frm.clear_custom_buttons(); if(doc.docstatus === 1 && doc.status!=="Lost") { cur_frm.add_custom_button(__('Create Quotation'), cur_frm.cscript.create_quotation);