Override Item Selection in Purchase Receipt

In the Purchase Receipt, by default the items which are marked as purchase item are shown. This logic is available in the buying.js

I want to extend that and make additional filter for showing the items.

In my custom app js, i tried to add the following

frappe.ui.form.on(“Purchase Receipt”, {
frm.set_query(“item_code”, “items”, function() {
return {
filters: [
[‘Item’,‘item_code’,‘not like’,‘XX%’]



However, this is not getting called and the filter code in buying.js is called.

Anything else we need to do to override the Default item listing functionality in purchase receipt?