Try ERPNext Buy Support Partners Foundation

Help Required : frappe.exceptions.ValidationError: Atleast one warehouse is mandatory

I’m trying to create a stock entry by Material Receipt

{
    "stock_entry_type": "Material Receipt",
    "series": "MAT-STE-.YYYY",
    "company": "ABC",
    "target_warehouse": "X - B",
    "items": [
        {
            "target_warehouse": "X - B",
            "item_code": "B",
            "qty": 1
        }
    ]
}

I’m getting the error as

File “/home/ubuntu/erpnext_1/poc-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 58, in validate
self.validate_warehouse()
File “/home/ubuntu/erpnext_1/poc-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 283, in validate_warehouse
frappe.throw(_(“Atleast one warehouse is mandatory”))
File “/home/ubuntu/erpnext_1/poc-bench/apps/frappe/frappe/init.py”, line 396, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/ubuntu/erpnext_1/poc-bench/apps/frappe/frappe/init.py”, line 375, in msgprint
_raise_exception()
File “/home/ubuntu/erpnext_1/poc-bench/apps/frappe/frappe/init.py”, line 326, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Atleast one warehouse is mandatory

Can someone please help me with this?

I remember that warehouse field as t_warehouse, s_warehouse. Did you check them?

1 Like