opened 12:37PM - 12 Feb 25 UTC
bug
### Information about bug
**Steps to Reproduce:**
1. Navigate to the POS page.…
2. Add a batch-enabled item.
3. Observe that the item details are not fetched properly.
4. The system throws an error during the process.
**Expected Behavior:**
The batch item details should be fetched correctly, including pricing, quantity, and other relevant details, without any errors. Additionally, a popup to select the batch of the item should be displayed.
**Actual Behavior**
https://github.com/user-attachments/assets/3649a0ba-657a-4208-ab69-276b8ee3cc81
**Additional Notes**
This issue seems to occur because the **doc** variable is None in the **update_stock** function, and the code is trying to call the get method on it. Proper validation or handling for NoneType is missing
### Module
selling
### Version
> "erpnext": "16.0.0-dev",
> "frappe": "16.0.0-dev"
### Installation method
manual install
### Relevant log output / Stack trace / Full Error Message.
```shell
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 115, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
...
File "apps/erpnext/erpnext/stock/get_item_details.py", line 142, in get_item_details
update_stock(ctx, out, doc)
File "apps/erpnext/erpnext/stock/get_item_details.py", line 219, in update_stock
{"price_list": doc.get("selling_price_list"), "uom": out.uom, "batch_no": batch_no},
^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
```