mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 04:15:10 +00:00
fix: warning message for COGS account in the stock entry
(cherry picked from commit bba6b0ff45)
This commit is contained in:
committed by
Mergify
parent
09e7bfbacb
commit
7abe199e2a
@@ -6,7 +6,7 @@ import json
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _, bold
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
from frappe.query_builder.functions import Sum
|
from frappe.query_builder.functions import Sum
|
||||||
from frappe.utils import (
|
from frappe.utils import (
|
||||||
@@ -526,6 +526,14 @@ class StockEntry(StockController):
|
|||||||
OpeningEntryAccountError,
|
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):
|
def validate_warehouse(self):
|
||||||
"""perform various (sometimes conditional) validations on warehouse"""
|
"""perform various (sometimes conditional) validations on warehouse"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user