test: stock frozen validation

(cherry picked from commit 75bc404cbe)
This commit is contained in:
Ankush Menat
2021-12-10 12:39:38 +05:30
committed by mergify-bot
parent 9e69725102
commit 140e91f459
2 changed files with 26 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import erpnext
class InvalidWarehouseCompany(frappe.ValidationError): pass
class PendingRepostingError(frappe.ValidationError): pass
def get_stock_value_from_bin(warehouse=None, item_code=None):
values = {}
@@ -432,7 +433,7 @@ def check_pending_reposting(posting_date: str, throw_error: bool = True) -> bool
if reposting_pending and throw_error:
msg = _("Stock/Accounts can not be frozen as processing of backdated entries is going on. Please try again later.")
frappe.msgprint(msg,
raise_exception=frappe.ValidationError,
raise_exception=PendingRepostingError,
title="Stock Reposting Ongoing",
indicator="red",
primary_action={