Sounds odd, but for the case where you have a "composition of objects" stacked together, such as many crates and steel box containers, it leaves all of the Inventory menus accessible to every one of those crates, even if empty.
If you wish to treat that composition as 1 single object with a single purpose, then you would want those multiple individual Inventory menu options disabled.
There is already a solution to this if you are creating an addon, but if you want a scripting only solution, it seems you would need another script command.