How to hide options in form view

1 Like

I dont know what is the exact issue.

thanks for sharing

Try one thing disable all other Purchase Invoice script and enable only this one and check its working or not.

frappe.ui.form.on('Purchase Invoice', {
    refresh(frm) {
        frm.remove_custom_button("Return / Debit Note", 'Create');
        frm.remove_custom_button('Purchase Receipt', 'Create');        
        frm.remove_custom_button('Accounting Ledger', 'View');
        frm.remove_custom_button('Stock Ledger', 'View');
        frm.remove_custom_button('UnReconcile', 'Actions');
        frm.removr_custom_buton('Payment Request','Create')
    }
});

I have added workflow , still its working

@Vipul_Kumar

disabled all and enabled this one only, still not working.

Need to figure out what i’m doing wrong.

Hi @rs115199789:

First, try to disable other scripts and check if it works. It should.

Tried not working :frowning:

Hi @rs115199789:

It’s pretty misterious …
Tried to run directly on browser console?

cur_frm.remove_custom_button('Payment Request','Create')

After this … still showing Payment Request option?

Hi @avc @Vipul_Kumar

It’s finally working after clearing browser cache :smiling_face_with_tear:

1 Like