diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index f1d274dd4f..18140615df 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -105,7 +105,12 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ }); } - if(this.frm.fields_dict["payment_terms_template"]){ + if( + this.frm.fields_dict["payment_terms_template"] + && this.frm.fields_dict["payment_schedule"] + && this.frm.doc.payment_terms_template + && !this.frm.doc.payment_schedule.length + ){ this.frm.trigger("payment_terms_template"); }