diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 21fba7b1e7..b86a5a5287 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -23,7 +23,7 @@ frappe.ui.form.on("Opportunity", { refresh: function(frm) { var doc = frm.doc; frm.events.enquiry_from(frm); - if(doc.status!=="Lost") { + if(!doc.__islocal && doc.status!=="Lost") { if(doc.with_items){ frm.add_custom_button(__('Supplier Quotation'), function() { @@ -109,7 +109,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { erpnext.toggle_naming_series(); var frm = cur_frm; - if(frm.perm[0].write && doc.docstatus==0) { + if(!doc.__islocal && frm.perm[0].write && doc.docstatus==0) { if(frm.doc.status==="Open") { frm.add_custom_button(__("Close"), function() { frm.set_value("status", "Closed");