From 5dc2e80987f2d8fea0513f05bcd5006f5d13da08 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 9 Jan 2024 15:57:38 +0530 Subject: [PATCH] fix: Ignore default payment terms template for opening invoices (cherry picked from commit 53bf44d2b870aad620c07fc72007c1a51e4eca9f) --- erpnext/controllers/accounts_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 7986c3d480..9a6044f8d7 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1947,7 +1947,7 @@ class AccountsController(TransactionBase): self.remove(item) def set_payment_schedule(self): - if self.doctype == "Sales Invoice" and self.is_pos: + if (self.doctype == "Sales Invoice" and self.is_pos) or self.get("is_opening") == "Yes": self.payment_terms_template = "" return @@ -2130,7 +2130,7 @@ class AccountsController(TransactionBase): ) def validate_payment_schedule_amount(self): - if self.doctype == "Sales Invoice" and self.is_pos: + if (self.doctype == "Sales Invoice" and self.is_pos) or self.get("is_opening") == "Yes": return party_account_currency = self.get("party_account_currency")