Error when Open POS

I cannot open my POS and getting this error:

AttributeError: ‘ProductBundleItem’ object has no attribute ‘stock_qty’
image

App Versions

{
	"education": "0.0.1",
	"erpnext": "14.21.0",
	"erpnext_marketplace": "0.0.1",
	"frappe": "14.32.0",
	"hrms": "14.2.1",
	"payments": "0.0.1"
}

Route

point-of-sale

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1607, in call
    return fn(*args, **newargs)
  File "apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py", line 165, in get_items
    item_stock_qty, is_stock_item = get_stock_availability(item_code, warehouse)
  File "apps/erpnext/erpnext/accounts/doctype/pos_invoice/pos_invoice.py", line 637, in get_stock_availability
    return get_bundle_availability(item_code, warehouse), is_stock_item
  File "apps/erpnext/erpnext/accounts/doctype/pos_invoice/pos_invoice.py", line 653, in get_bundle_availability
    max_available_bundles = available_qty / item.stock_qty
AttributeError: 'ProductBundleItem' object has no attribute 'stock_qty'

Request Data

{
	"type": "POST",
	"args": {
		"start": 0,
		"page_length": 40,
		"price_list": "Gojek",
		"item_group": "All Item Groups",
		"search_term": "",
		"pos_profile": "Main"
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.selling.page.point_of_sale.point_of_sale.get_items"
}

Response Data

{
	"exception": "AttributeError: 'ProductBundleItem' object has no attribute 'stock_qty'"
}

The end result is none of my item loaded in the POS page.

Hi @oscarutomo,

If you created a Product Bundle, then will not work POS.

Please check the video.

So please remove the Item from Product Bundle and then reload and check it.

Hope you understand.
Thank You!

2 Likes

oh… why?
Does it mean that i cannot even add 1 Product Bundle if i want to use Point of Sale?
but then how if my resto selling Burger which contains Vegetables, Patty, etc?

Hi @oscarutomo,

I don’t know,
We did just share the video regarding the error.

Thank You!

oh I see…

hopefully there is someone here can help to answer why we face error when have Product Bundle

On erpnext/accounts/doctype/pos_invoice/pos_invoice.py
Line number 653
field name item.stock_qty is wrong. There is no field called stock_qty in doctype “Product Bundle Item”. Only field available is “qty”
I temporarily fixed on my instance by changing the line from
max_available_bundles = available_qty / item.stock_qty
to
max_available_bundles = available_qty / qty

Need a bug fix on this issue Attribute Error while opening Point Of Sale - v14 · Issue #34302 · frappe/erpnext · GitHub

When i follow your changes, does it will not effect other Item that not Product Bundle? I don’t understand fully yet but seems this will force system to read “qty” field no matter it is product bundle or Item. Am i correct?

Anw, i will try it asap. Thanks.

It is just reading the data, not writing anything. So there will be no impact I guess.