Filter by Item Group

Hi again!

Today I’m trying to filter the Customer based on Customer Group, using the same script, but it doesn’t make any changes.

frappe.ui.form.on("Quotation", "refresh", function(frm) {
    cur_frm.fields_dict['customer'].get_query = function(doc, cdt, cdn) {
    	return {
    		filters:[
    			['customer_group', '=', 'doc.tipo_de_orden']
    		]
    	}
    }
});

Also tried…

frappe.ui.form.on("Quotation", "refresh", function(frm) {
        	cur_frm.set_query("customer", function() {
                return {
                    "filters": {
                        "customer_group": cur_frm.doc.tipo_de_orden
                    }
                };
            });
        };
        });

I tried changing “refresh” for “tipo_de_orden”… but nothing.

Any thoughts?