fix: Validate income/expense account in sales and purchase invoice
(cherry picked from commit 06936cf1c0)
This commit is contained in:
committed by
mergify-bot
parent
face53ae8e
commit
935d2e3d64
@@ -1567,12 +1567,12 @@ def validate_taxes_and_charges(tax):
|
||||
tax.rate = None
|
||||
|
||||
|
||||
def validate_account_head(idx, account, company):
|
||||
def validate_account_head(idx, account, company, context=''):
|
||||
account_company = frappe.get_cached_value('Account', account, 'company')
|
||||
|
||||
if account_company != company:
|
||||
frappe.throw(_('Row {0}: Account {1} does not belong to Company {2}')
|
||||
.format(idx, frappe.bold(account), frappe.bold(company)), title=_('Invalid Account'))
|
||||
frappe.throw(_('Row {0}: {3} Account {1} does not belong to Company {2}')
|
||||
.format(idx, frappe.bold(account), frappe.bold(company), context), title=_('Invalid Account'))
|
||||
|
||||
|
||||
def validate_cost_center(tax, doc):
|
||||
|
||||
Reference in New Issue
Block a user