Is there a way to prevent a warehouse from being available for mrp?

I’m looking for a way to prevent a particular warehouse inventory from being visible to material requirements planning. For example, I’ve setup a Research and Development warehouse. I don’t want any inventory in the R&D warehouse from being available for requirements planning. Is there a way to do this?

Alternatively, is there maybe a better practice than using a warehouse for R&D or testing?

Hi @jvantslot! I suggest you add a tick in your R&D warehouse like “is_research” or something. Afterwhich, you have to add this JS script in your Doctype where the warehouse link needs to be filtered:

frappe.ui.form.on("doctype_name_here", "onload", function(frm) {
    cur_frm.set_query("warehouse", function() {
        return {
            "filters": {
                "is_research": 0
            }
        };
    });
});

Hope this helps!

1 Like

Thanks for the suggestion.

I was hoping there was a method that didn’t require code modification.

I’d probably name the field something like mrp_available or something, in order to cover some other use cases like QC Hold warehouse etc. Basically any warehouse that might contain stock that should not be considered available to manufacture.

Do you know where I would need to modify the code for the production planning tool, item shortage report and any other place that looks for item availability? I suspect this might impact a number of functions in the production planning tool and availability reports. I’m not so keen to make any custom modifications without knowing I’ve made them for all functions that look at raw material availability.