mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-28 19:18:32 +00:00
Removed 'Root Type' validation for receivable/payable account in sales/purchase invoice
This commit is contained in:
@@ -88,9 +88,7 @@ class PurchaseInvoice(BuyingController):
|
||||
throw(_("Conversion rate cannot be 0 or 1"))
|
||||
|
||||
def validate_credit_to_acc(self):
|
||||
root_type, account_type = frappe.db.get_value("Account", self.credit_to, ["root_type", "account_type"])
|
||||
if root_type != "Liability":
|
||||
frappe.throw(_("Credit To account must be a liability account"))
|
||||
account_type = frappe.db.get_value("Account", self.credit_to, "account_type")
|
||||
if account_type != "Payable":
|
||||
frappe.throw(_("Credit To account must be a Payable account"))
|
||||
|
||||
|
||||
@@ -235,9 +235,7 @@ class SalesInvoice(SellingController):
|
||||
reconcile_against_document(lst)
|
||||
|
||||
def validate_debit_to_acc(self):
|
||||
root_type, account_type = frappe.db.get_value("Account", self.debit_to, ["root_type", "account_type"])
|
||||
if root_type != "Asset":
|
||||
frappe.throw(_("Debit To account must be a liability account"))
|
||||
account_type = frappe.db.get_value("Account", self.debit_to, "account_type")
|
||||
if account_type != "Receivable":
|
||||
frappe.throw(_("Debit To account must be a Receivable account"))
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ def execute():
|
||||
account_settings = frappe.get_doc("Accounts Settings")
|
||||
|
||||
if not account_settings.frozen_accounts_modifier and account_settings.bde_auth_role:
|
||||
frappe.db.set_value("Account Settings", None,
|
||||
frappe.db.set_value("Accounts Settings", None,
|
||||
"frozen_accounts_modifier", account_settings.bde_auth_role)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user