From a7f55895640bb015fe28a8f38ce4716091255891 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Mon, 2 Apr 2018 10:32:00 +0530 Subject: [PATCH] fix for the update button in the sales invoice (#13435) --- erpnext/controllers/accounts_controller.py | 4 +++- erpnext/public/js/controllers/transaction.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 1af2fdd70d7..d690241736e 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -666,7 +666,9 @@ class AccountsController(TransactionBase): self.remove(item) def set_payment_schedule(self): - if self.doctype == 'Sales Invoice' and self.is_pos: return + if self.doctype == 'Sales Invoice' and self.is_pos: + self.payment_terms_template = '' + return posting_date = self.get("bill_date") or self.get("posting_date") or self.get("transaction_date") date = self.get("due_date") diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index eae5283d321..9ed20c9bfa0 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -106,7 +106,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ } if( - this.frm.fields_dict["payment_terms_template"] + this.frm.docstatus < 2 + && 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