diff --git a/erpnext/accounts/doctype/purchase_invoice/services/expense_account.py b/erpnext/accounts/doctype/purchase_invoice/services/expense_account.py index 9f2d949d9a7..df03a9a838f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/services/expense_account.py +++ b/erpnext/accounts/doctype/purchase_invoice/services/expense_account.py @@ -51,16 +51,6 @@ class ExpenseAccountService: if doc.update_stock and item.warehouse and (not item.from_warehouse): _inv_dict = doc.get_inventory_account_dict(item, inventory_account_map) - if for_validate and item.expense_account and item.expense_account != _inv_dict["account"]: - msg = _( - "Row {0}: Expense Head changed to {1} because account {2} is not linked to warehouse {3} or it is not the default inventory account" - ).format( - item.idx, - frappe.bold(_inv_dict["account"]), - frappe.bold(item.expense_account), - frappe.bold(item.warehouse), - ) - frappe.msgprint(msg, title=_("Expense Head Changed")) item.expense_account = _inv_dict["account"] else: # check if 'Stock Received But Not Billed' account is credited in Purchase receipt or not