Try ERPNext Buy Support Partners Foundation

Filter doctypes by module name custom script

Hello

How can we do filter doctypes by module in custom script . I dont know if this code is correct . any help please

 doc_type: function(cur_frm, cdt, cdn) {
 // get doc by filters
    var module = frappe.model.get_value(cdt, cdn,"module_doc");
    cur_frm.set_query("doc_type", function() {
	  return {
		filters: [
			  ['Doctype', 'module', '=', module]
			]
		};
	});