Merge pull request #47452 from rohitwaghchaure/fixed-support-37892

fix: warning message for COGS account in the stock entry
This commit is contained in:
rohitwaghchaure
2025-05-07 16:18:50 +05:30
committed by GitHub

View File

@@ -6,7 +6,7 @@ import json
from collections import defaultdict
import frappe
from frappe import _
from frappe import _, bold
from frappe.model.mapper import get_mapped_doc
from frappe.query_builder.functions import Sum
from frappe.utils import (
@@ -545,6 +545,14 @@ class StockEntry(StockController):
OpeningEntryAccountError,
)
if self.purpose != "Material Issue" and acc_details.account_type == "Cost of Goods Sold":
frappe.msgprint(
_(
"At row {0}: You have selected the Difference Account {1}, which is a Cost of Goods Sold type account. Please select a different account"
).format(d.idx, bold(get_link_to_form("Account", d.expense_account))),
title=_("Warning : Cost of Goods Sold Account"),
)
def validate_warehouse(self):
"""perform various (sometimes conditional) validations on warehouse"""