Create the needed fields as type check is_sales_item , is_purchase_item , is_manufacture_item o whatever name you want to use.
go to setup > custom scrips and add the fallowing for each doctype that is required to filter the items. Ex for sales invoice . Create custom scrip for sales invoice and add
frappe.ui.form.on(“Sales Invoice”, “refresh”, function(frm) {
cur_frm.fields_dict[‘items’].grid.get_field(‘item_code’).get_query = function(doc, cdt, cdn) {
return {
filters:[
[‘is_sales_item’, ‘=’, ‘1’]
]
}
}
});
for puchase you can go to purchase order and do the same the scrip will be like this:
Thanks for the details !
But its really frustrating to see such basic functionality removed which i think is very important for a manufacturing setup!
There surely is a workaround , but now we have to do the following:
Modify the script as mentioned for all the documents - through out the work flow
Modify @ 3500 raw materials - which are purchase only items
@ 300 sub assemblies - only manufactured - neither purchased nor Sold
@ 75 Finished good / accessories - only manufacturing & sales - no purchase
Rgds,
For what i know i you already had check the item is_purchase / is_sold in v6 the data is already stored in the mariadb so creating the fields again will update automatically. anyway you can check your database for the values there.
It’s a feature that made things more organized and if it wasn’t somehow causing issues in the code then I’m really wondering why it was removed in the first place. ERPNext uses the same item master for everything (products, raw materials, assets, consumables etc) and letting all these items pop-up when trying to make a Sale (or a Purchase as the case may be) makes the system look disorganized in some way. It’s also a potential source of errors in entry
There’s no need causing users unnecessary headaches and frustration over basic things like this. Please reconsider
Maybe some sort of notification or help message letting users know that Items not marked as ‘Purchase Items’ are not appearing in the Purchase Order might also be a way out? There could also be something in the settings that allows a user decide if he/she wants this functionality turned on/off?
In any case, please just consider all available options especially for the sake of users who really need this. Personally, it’s not very high priority for me but I know how it feels to have a feature that’s important to your business suddenly removed
As always, can’t thank you and the team enough for the great work you’re doing
It worked wonderfully for both the Sales Order and the Purchase Receipt.
@Randy_Lowery, do you think you could help me adapt the script for the BOM item? I want to filter the BOM’s main item, not the ones in the item list. Thanks!
I think this feature is too important to be removed. It made dealing with items so much easier.
Maybe you could add an option to enable/disable the filtering in the selling/purchase setup instead of removing it.
I’m looking at this same feature and I don’t understand why it’s been removed. Now all my RAW MATERIALS are coming as sale item in POS. I’m not a program so would attempt to make code changes and hopefully this option can be added back on in the next update as it seems its a quick change.
I still think the Original option was more better & already set for all the items for existing users !
The Is manufactured item is still missing .That is also important .
One suggestion is - the Default setting when the item is created can be
Is Purchase is enabled
Is Sales is enabled
Is Manufactured is enabled .
& if required can be changed further for respective items as required
This implementation shall be more better for existing user!
I agree with @chetan. Why not just make ‘Is Sales Item’, ‘Is Purchase Item’, ‘Is Manufactured Item’ checked by default? This easily addresses the issue you’re concerned about and also makes existing users happy
Hi @nabinhait,
Good to see with the latest round of changes, this feature has been added back. It works fine for sales order, if an item is not for sale the item doesn’t show in the list. But in POS the none sale items show up as well.
Is there a separate setting in POS via config or code?