Error in stock Entry while accessing Item through link field

Hello all,

I am using ERPNext: v6.27.22 and Frappe Framework: v6.27.21

I am getting this error While selecting item through dropdown link field in stock entry


Traceback (most recent call last):
  File "/home/frappe-bench/apps/frappe/frappe/", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe-bench/apps/frappe/frappe/", line 19, in handle
  File "/home/frappe-bench/apps/frappe/frappe/", line 36, in execute_cmd
    ret =, **frappe.form_dict)
  File "/home/frappe-bench/apps/frappe/frappe/", line 854, in call
    return fn(*args, **newargs)
  File "/home/frappe-bench/apps/frappe/frappe/desk/", line 13, in search_link
    search_widget(doctype, txt, query, searchfield=searchfield, page_len=page_len, filters=filters)
  File "/home/frappe-bench/apps/frappe/frappe/desk/", line 35, in search_widget
    searchfield, start, page_len, filters, as_dict=as_dict)
  File "/home/frappe-bench/apps/frappe/frappe/", line 854, in call
    return fn(*args, **newargs)
  File "/home/frappe-bench/apps/erpnext/erpnext/controllers/", line 187, in item_query
    fcond=get_filters_cond(doctype, filters, conditions).replace('%', '%%'),
  File "/home/frappe-bench/apps/erpnext/erpnext/controllers/", line 25, in get_filters_cond
    query.build_filter_conditions(flt, conditions)
  File "/home/frappe-bench/apps/frappe/frappe/model/", line 247, in build_filter_conditions
  File "/home/frappe-bench/apps/frappe/frappe/model/", line 315, in prepare_filter_condition
    if self.ignore_ifnull or not can_be_null:
AttributeError: 'DatabaseQuery' object has no attribute 'ignore_ifnull'

How can I solve this within the same version?

Thanks in Advance

Thanks for saurabh

Just added this line in

self.ignore_ifnull = False

and it works.Thanks

1 Like