From 277f4a1bfe584ac3c366d4cac7c7563de290579d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 12 Jun 2014 12:59:23 +0530 Subject: [PATCH] Removed clear_custom_buttons, pos view switch fix --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 2 +- erpnext/public/js/transaction.js | 1 - erpnext/selling/doctype/lead/lead.js | 1 - erpnext/selling/doctype/opportunity/opportunity.js | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 034880a211b..bfb500c665c 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 27ee1521c89..2c372042eab 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 286ce3593c8..ba9741b4f69 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 4cc95ad59bb..ce7c6ea2738 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);