Try ERPNext Buy Support Partners Foundation

DocType Bin data not accessible

I’m trying to get the list of Item that are there in Bin List.
to get an Item from Bin using frappe.get_list(), first i have to get it to locals using frappe.db.get_value() because frappe.db.get_list() gives argument error.

1: The script that i’m trying to write is
frappe.db.get_list(‘Bin’, filters={‘item_code’: ‘PM097’}, fieldname=[‘valuation_rate’]) , but here i get an error stating TypeError: execute() got an unexpected keyword argument ‘item_code’ , where the item_code is a column name in Bin.

2: Write now i get values using
frappe.db.get_value(‘Bin’, filters={‘item_code’: ‘PM097’}, fieldname=[‘valuation_rate’]) , but here this only gives me the very latest value and not all the entries found in the list with the Item_code = ‘PM097’.

how can i get the entire list from Bin doctype list using filters and selecting a specific one whenever required.

Use frappe.db.get_all Documentation

Thanks for the help @Javier_Lopez.
While checking for other options i discovered
frappe.db.get_list(‘DocType’, {filters: {‘fieldname’: value}, fields: [‘fileds_to_received’] , this one worked after replacing the = with :

1 Like