Conditionally toggle Naming Series. Fixes #1526
This commit is contained in:
parent
7f2d08b03f
commit
8bde7f9b3a
@ -111,7 +111,7 @@ cur_frm.script_manager.make(erpnext.accounts.JournalVoucher);
|
||||
|
||||
cur_frm.cscript.refresh = function(doc) {
|
||||
cur_frm.cscript.is_opening(doc)
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
cur_frm.cscript.voucher_type(doc);
|
||||
if(doc.docstatus==1) {
|
||||
cur_frm.appframe.add_button(__('View Ledger'), function() {
|
||||
|
@ -5,7 +5,12 @@
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||
cur_frm.cscript.make_dashboard(doc);
|
||||
erpnext.hide_naming_series();
|
||||
|
||||
if(frappe.defaults.get_default("supp_master_name")!="Naming Series") {
|
||||
cur_frm.toggle_display("naming_series", false);
|
||||
} else {
|
||||
erpnext.toggle_naming_series();
|
||||
}
|
||||
|
||||
if(doc.__islocal){
|
||||
hide_field(['address_html','contact_html']);
|
||||
|
@ -19,7 +19,7 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
|
||||
|
||||
refresh: function() {
|
||||
var me = this;
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
if(!this.frm.doc.__islocal) {
|
||||
cur_frm.add_custom_button(__('Make Salary Structure'), function() {
|
||||
me.make_salary_structure(this); });
|
||||
|
@ -12,7 +12,7 @@ $.extend(cur_frm.cscript, {
|
||||
|
||||
refresh: function(doc, dt, dn) {
|
||||
this.frm.dashboard.reset();
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
this.frm.set_intro("");
|
||||
cfn_set_fields(doc, dt, dn);
|
||||
|
||||
|
@ -45,7 +45,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
|
||||
refresh: function() {
|
||||
this.frm.clear_custom_buttons();
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
erpnext.hide_company();
|
||||
this.show_item_wise_taxes();
|
||||
this.set_dynamic_labels();
|
||||
|
@ -12,7 +12,7 @@ $.extend(erpnext, {
|
||||
return frappe.boot.sysdefaults.currency;
|
||||
},
|
||||
|
||||
hide_naming_series: function() {
|
||||
toggle_naming_series: function() {
|
||||
if(cur_frm.fields_dict.naming_series) {
|
||||
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.ui.form.on("Campaign", "refresh", function(frm) {
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
if(frm.doc.__islocal) {
|
||||
frm.toggle_display("naming_series", frappe.boot.sysdefaults.campaign_naming_by=="Naming Series");
|
||||
}
|
||||
|
@ -20,7 +20,12 @@ cur_frm.add_fetch('default_sales_partner','commission_rate','default_commission_
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||
cur_frm.cscript.setup_dashboard(doc);
|
||||
erpnext.hide_naming_series();
|
||||
|
||||
if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
|
||||
cur_frm.toggle_display("naming_series", false);
|
||||
} else {
|
||||
erpnext.toggle_naming_series();
|
||||
}
|
||||
|
||||
if(doc.__islocal){
|
||||
hide_field(['address_html','contact_html']);
|
||||
|
@ -30,7 +30,7 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
||||
|
||||
refresh: function() {
|
||||
var doc = this.frm.doc;
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
this.frm.clear_custom_buttons();
|
||||
|
||||
this.frm.__is_customer = this.frm.__is_customer || this.frm.doc.__is_customer;
|
||||
|
@ -81,7 +81,7 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
|
||||
$.extend(cur_frm.cscript, new erpnext.selling.Opportunity({frm: cur_frm}));
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
cur_frm.clear_custom_buttons();
|
||||
|
||||
if(doc.docstatus === 1 && doc.status!=="Lost") {
|
||||
|
@ -7,8 +7,14 @@ cur_frm.cscript.refresh = function(doc) {
|
||||
// make sensitive fields(has_serial_no, is_stock_item, valuation_method)
|
||||
// read only if any stock ledger entry exists
|
||||
|
||||
cur_frm.cscript.make_dashboard()
|
||||
erpnext.hide_naming_series();
|
||||
cur_frm.cscript.make_dashboard();
|
||||
|
||||
if (frappe.defaults.get_default("item_naming_by")!="Naming Series") {
|
||||
cur_frm.toggle_display("naming_series", false);
|
||||
} else {
|
||||
erpnext.toggle_naming_series();
|
||||
}
|
||||
|
||||
|
||||
if(!doc.__islocal && doc.show_in_website) {
|
||||
cur_frm.appframe.add_button("View In Website", function() {
|
||||
|
@ -61,7 +61,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
|
||||
refresh: function() {
|
||||
var me = this;
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
this.toggle_related_fields(this.frm.doc);
|
||||
this.toggle_enable_bom();
|
||||
this.show_stock_ledger();
|
||||
|
@ -13,7 +13,7 @@ cur_frm.cscript.onload = function(doc) {
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc) {
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved
|
||||
&& inList(frappe.boot.user.can_write, doc.doctype)) {
|
||||
cur_frm.add_custom_button(__('Send'), function() {
|
||||
|
@ -17,7 +17,7 @@ $.extend(cur_frm.cscript, {
|
||||
},
|
||||
|
||||
refresh: function(doc) {
|
||||
erpnext.hide_naming_series();
|
||||
erpnext.toggle_naming_series();
|
||||
cur_frm.cscript.make_listing(doc);
|
||||
if(!doc.__islocal) {
|
||||
if(cur_frm.fields_dict.status.get_status()=="Write") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user