mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: if condition to validate doctype
(cherry picked from commit b23a2dd8e8)
This commit is contained in:
@@ -81,16 +81,25 @@ class StockController(AccountsController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def check_zero_rate(self):
|
def check_zero_rate(self):
|
||||||
for item in self.get("items"):
|
if self.doctype in [
|
||||||
if (item.get("valuation_rate") == 0 or item.get("incoming_rate") == 0) and item.get(
|
"POS Invoice",
|
||||||
"allow_zero_valuation_rate"
|
"Purchase Invoice",
|
||||||
) == 0:
|
"Sales Invoice",
|
||||||
frappe.toast(
|
"Delivery Note",
|
||||||
_(
|
"Purchase Receipt",
|
||||||
"Row #{0}: Item {1} has zero rate but 'Allow Zero Valuation Rate' is not enabled."
|
"Stock Entry",
|
||||||
).format(item.idx, frappe.bold(item.item_code)),
|
"Stock Reconciliation",
|
||||||
indicator="orange",
|
]:
|
||||||
)
|
for item in self.get("items"):
|
||||||
|
if (item.get("valuation_rate") == 0 or item.get("incoming_rate") == 0) and item.get(
|
||||||
|
"allow_zero_valuation_rate"
|
||||||
|
) == 0:
|
||||||
|
frappe.toast(
|
||||||
|
_(
|
||||||
|
"Row #{0}: Item {1} has zero rate but 'Allow Zero Valuation Rate' is not enabled."
|
||||||
|
).format(item.idx, frappe.bold(item.item_code)),
|
||||||
|
indicator="orange",
|
||||||
|
)
|
||||||
|
|
||||||
def validate_items_exist(self):
|
def validate_items_exist(self):
|
||||||
if not self.get("items"):
|
if not self.get("items"):
|
||||||
|
|||||||
Reference in New Issue
Block a user