I will suggest you check the code once, where the code for this button is written, so from there you will get an idea of what permission or logic needs to be satisfied to enable this button.
Check the URL, which page is it referring to, then go there and check. That’s it. If you are not a developer, then I don’t think it would be easy for you to try. I am not sure how familiar you are with Dolibarr development.
I got the dolibarr git cloned to my mac laptop, and then I used grep in the terminal to find all lines with INVOICE_CAN_
And I found that it seems like at least in the develop branch, the setting you need to use is INVOICE_CAN_NEVER_BE_REMOVED and the value should be 0 to remove the invoice.
If you invoices have payments, you might want to use INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED
You don’t write which dolibarr version you run, and I hope it is not develop.
sorry @TuHao I have not, and I am not being able to for at least a week. This weekend I am organizing a large dance event, which is what I use Dolibarr for, so I wont have time until next week, and before that I need to do the life things that this dance event has postponed.
You can find the source code on github, find the relevant file that matches the url you’re looking at and then you ask some AI to analyse how to use this variables to achieve what you want.
That is where I’d start, and then also read the code myself.