mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-27 02:28:30 +00:00
fix: zero valuation rate popup on SI (#54376)
(cherry picked from commit 3ef6c24f07)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
@@ -142,14 +142,19 @@ class StockController(AccountsController):
|
|||||||
]:
|
]:
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if (
|
if (
|
||||||
(item.get("valuation_rate") == 0 or item.get("incoming_rate") == 0)
|
(
|
||||||
|
item.get("valuation_rate") == 0
|
||||||
|
or (item.get("incoming_rate") == 0 and self.get("update_stock", 1))
|
||||||
|
)
|
||||||
and item.get("allow_zero_valuation_rate") == 0
|
and item.get("allow_zero_valuation_rate") == 0
|
||||||
and frappe.get_cached_value("Item", item.item_code, "is_stock_item")
|
and frappe.get_cached_value("Item", item.item_code, "is_stock_item")
|
||||||
):
|
):
|
||||||
frappe.toast(
|
frappe.toast(
|
||||||
_(
|
_("Row #{0}: Item {1} has zero rate but '{2}' is not enabled.").format(
|
||||||
"Row #{0}: Item {1} has zero rate but 'Allow Zero Valuation Rate' is not enabled."
|
item.idx,
|
||||||
).format(item.idx, frappe.bold(item.item_code)),
|
frappe.bold(item.item_code),
|
||||||
|
item.meta.get_label("allow_zero_valuation_rate"),
|
||||||
|
),
|
||||||
indicator="orange",
|
indicator="orange",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user