mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 01:34:10 +00:00
fix: Validate if item exists on uploading items in stock reco (#27538)
* fix: Validate if item exists on uploading items in stock reco
- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item
* chore: translation
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 9b388883d3)
This commit is contained in:
@@ -726,6 +726,11 @@ def get_stock_balance_for(
|
||||
|
||||
item_dict = frappe.db.get_value("Item", item_code, ["has_serial_no", "has_batch_no"], as_dict=1)
|
||||
|
||||
if not item_dict:
|
||||
# In cases of data upload to Items table
|
||||
msg = _("Item {} does not exist.").format(item_code)
|
||||
frappe.throw(msg, title=_("Missing"))
|
||||
|
||||
if not item_dict:
|
||||
# In cases of data upload to Items table
|
||||
msg = _("Item {} does not exist.").format(item_code)
|
||||
|
||||
Reference in New Issue
Block a user