mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +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"))
|
throw(_("Conversion rate cannot be 0 or 1"))
|
||||||
|
|
||||||
def validate_credit_to_acc(self):
|
def validate_credit_to_acc(self):
|
||||||
root_type, account_type = frappe.db.get_value("Account", self.credit_to, ["root_type", "account_type"])
|
account_type = frappe.db.get_value("Account", self.credit_to, "account_type")
|
||||||
if root_type != "Liability":
|
|
||||||
frappe.throw(_("Credit To account must be a liability account"))
|
|
||||||
if account_type != "Payable":
|
if account_type != "Payable":
|
||||||
frappe.throw(_("Credit To account must be a Payable account"))
|
frappe.throw(_("Credit To account must be a Payable account"))
|
||||||
|
|
||||||
|
|||||||
@@ -235,9 +235,7 @@ class SalesInvoice(SellingController):
|
|||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
|
|
||||||
def validate_debit_to_acc(self):
|
def validate_debit_to_acc(self):
|
||||||
root_type, account_type = frappe.db.get_value("Account", self.debit_to, ["root_type", "account_type"])
|
account_type = frappe.db.get_value("Account", self.debit_to, "account_type")
|
||||||
if root_type != "Asset":
|
|
||||||
frappe.throw(_("Debit To account must be a liability account"))
|
|
||||||
if account_type != "Receivable":
|
if account_type != "Receivable":
|
||||||
frappe.throw(_("Debit To account must be a Receivable account"))
|
frappe.throw(_("Debit To account must be a Receivable account"))
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ def execute():
|
|||||||
account_settings = frappe.get_doc("Accounts Settings")
|
account_settings = frappe.get_doc("Accounts Settings")
|
||||||
|
|
||||||
if not account_settings.frozen_accounts_modifier and account_settings.bde_auth_role:
|
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)
|
"frozen_accounts_modifier", account_settings.bde_auth_role)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user