fix: Make discount_account mandatory if discount accounting is enabled

This commit is contained in:
GangaManoj 2021-07-20 03:52:39 +05:30 committed by Deepesh Garg
parent 566e8f8499
commit 1f6c05f013

View File

@ -40,6 +40,7 @@ class AccountsSettings(Document):
for doctype in ["Sales Invoice Item", "Purchase Invoice Item"]:
make_property_setter(doctype, "discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
make_property_setter(doctype, "discount_account", "mandatory", enable_discount_accounting, "Check", validate_fields_for_doctype=False)
for doctype in ["Sales Invoice", "Purchase Invoice"]:
make_property_setter(doctype, "additional_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)