From 590bd0a8e51fac71191fb3802f31bfcd620c09cc Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Mon, 25 Dec 2017 07:10:19 +0100 Subject: [PATCH] trigger payment_terms_template only when needed (#12124) --- erpnext/public/js/controllers/transaction.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index f1d274dd4f1..18140615dfc 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"); }