mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fix: Set Expense account from warehouse only if warehouse exists
This commit is contained in:
@@ -246,7 +246,7 @@ class PurchaseInvoice(BuyingController):
|
||||
and (not item.po_detail or
|
||||
not frappe.db.get_value("Purchase Order Item", item.po_detail, "delivered_by_supplier")):
|
||||
|
||||
if self.update_stock and (not item.from_warehouse):
|
||||
if self.update_stock and item.warehouse and (not item.from_warehouse):
|
||||
if for_validate and item.expense_account and item.expense_account != warehouse_account[item.warehouse]["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(warehouse_account[item.warehouse]["account"]), frappe.bold(item.expense_account), frappe.bold(item.warehouse))
|
||||
|
||||
Reference in New Issue
Block a user