bugfix: call set_payment_schedule only in relevant doc

This commit is contained in:
tunde 2017-09-11 15:45:10 +01:00
parent df3a175974
commit ecb118fb3b

View File

@ -26,9 +26,10 @@ class AccountsController(TransactionBase):
return self.__company_currency return self.__company_currency
def onload(self): def onload(self):
print("onload called:", self.get("__onload"))
self.get("__onload").make_payment_via_journal_entry = frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry') self.get("__onload").make_payment_via_journal_entry = frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
self.set_payment_schedule() relevant_docs = ("Quotation", "Purchase Order", "Sales Order", "Purchase Invoice", "Purchase Order")
if self.doctype in relevant_docs:
self.set_payment_schedule()
def validate(self): def validate(self):
if self.get("_action") and self._action != "update_after_submit": if self.get("_action") and self._action != "update_after_submit":