fix bug: form is always dirty

This commit is contained in:
tunde 2017-09-25 09:02:23 +01:00
parent 77ecacc379
commit e52bb825ec

View File

@ -27,9 +27,10 @@ class AccountsController(TransactionBase):
def onload(self): def onload(self):
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')
relevant_docs = ("Quotation", "Purchase Order", "Sales Order", "Purchase Invoice", "Purchase Order") if self.is_new():
if self.doctype in relevant_docs: relevant_docs = ("Quotation", "Purchase Order", "Sales Order", "Purchase Invoice", "Purchase Order")
self.set_payment_schedule() 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":