I’m relatively new to ERPNext and have been using it for a few months—I really like it so far!
I have a custom Doctype called “eBay Listings”, which is linked to Item via the item_code field.
Problem:
In the Item List View, I want to filter and find all Items that do not have a linked eBay Listing. However, I couldn’t find an elegant way to achieve this with the built-in filters.
What I’ve Tried:
Using standard filters in the Item List View, but there is no direct way to filter based on a linked Doctype.
Exploring custom fields to count related eBay Listings, but I prefer an out-of-the-box solution.
Attempting a Custom Script to filter the List View dynamically, but I’m not sure if there’s a simpler way.
Question:
Is there a native way in ERPNext to filter Items without a linked eBay Listing in the List View?
Or do I need a custom SQL report or Client Script to achieve this?
Would really appreciate any guidance or best practices on how to implement this efficiently.
Computed and relational fields are a bit of a gap in the Frappe ORM. This would be trivial to create in a report, but I’m not aware of any simple way to do it in the current list view.
One approach would be to create custom checkbox field in your Item doctype (has_ebay_listing, or something) and then an on_save hook in your new doctype. The on_save hook updates the item checkbox whenever an ebay listing is changed. It creates some redundant data that can possibly get out of sync, which makes it a less-than-ideal solution, but it should work fine.
You’ll still have problems if you set the link field to Item A and then change it to Item B (the item A tally will not be removed), but perhaps that’s not possible in your workflow.