Files
erpnext/erpnext
Dipen Gala df324e4ad6 fix: remove unnecessary expense head warning for purchase invoices with update stock
When a Purchase Invoice is created with `update_stock = 1`, the system
automatically replaces the item's expense account with the correct
inventory account for perpetual inventory. This is expected behaviour,
but a `frappe.msgprint` warning was being shown to the user:

  "Expense Head changed to Stock In Hand because account Cost of Goods
   Sold is not linked to warehouse Stores or it is not the default
   inventory account."

The message is purely informational, provides no actionable guidance,
and confuses users who deliberately enable Update Stock. The underlying
account substitution logic is unchanged; only the popup is suppressed.

The two other `msgprint` calls (for the Purchase-Receipt-linked and
no-Purchase-Receipt flows) are intentionally preserved — those surface
a genuine change in behaviour that users may not expect.

Fixes: https://github.com/frappe/erpnext/issues/...
(cherry picked from commit 224dff32df)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/services/expense_account.py
2026-06-12 08:02:30 +00:00
..
2026-01-13 10:50:15 +05:30
2022-03-28 18:52:46 +05:30
2022-04-28 12:02:54 +05:30
2026-06-11 20:28:55 +05:30
2026-05-23 15:35:19 +05:30
2022-03-28 18:52:46 +05:30