[Fix] System always fetches the payment terms template from the company even if it's removed from the sales invoice (#14879)

This commit is contained in:
rohitwaghchaure
2018-07-13 17:40:48 +05:30
committed by Nabin Hait
parent 5c3b69476d
commit 3ffe89659a
3 changed files with 24 additions and 11 deletions

View File

@@ -138,9 +138,11 @@ class AccountsController(TransactionBase):
if not self.due_date:
frappe.throw(_("Due Date is mandatory"))
validate_due_date(self.posting_date, self.due_date, "Customer", self.customer, self.company)
validate_due_date(self.posting_date, self.due_date,
"Customer", self.customer, self.company, self.payment_terms_template)
elif self.doctype == "Purchase Invoice":
validate_due_date(self.posting_date, self.due_date, "Supplier", self.supplier, self.company)
validate_due_date(self.posting_date, self.due_date,
"Supplier", self.supplier, self.company, self.payment_terms_template)
def set_price_list_currency(self, buying_or_selling):
if self.meta.get_field("posting_date"):