开发者

Dont want to uninstall my module in openerp

开发者 https://www.devze.com 2023-02-20 07:36 出处:网络
My requirement is that if anyone install my module in openerp gtk-client after that he/开发者_如何学运维she can\'t uninstall that module in current database.Consider database name as \'XYZ\'.I found a

My requirement is that if anyone install my module in openerp gtk-client after that he/开发者_如何学运维she can't uninstall that module in current database.Consider database name as 'XYZ'.


I found a solution by inheriting the ir.module.module class and overriding the button_uninstall method.


To uninstall a module, you can go to Administration / Modules / Modules... search and open your module.

Then, there is a "uninstall" button to uninstall your module. However, it's a Beta version of the functionnality. I've never had a problem yet.

EDIT:

According to your comment, the only way to do that is to specify a security file to prevent a user can go into the administration menu.


As I recall, the use control module could not be uninstalled. There was a big discussion about it in this bug, and it's since been removed from the extra addons branch. You could poke around in the source code to figure out what it was doing to be so nasty.


Not quite what you asked, but you could maybe configure __openerp__.py to:

  • set you module in the Hidden category
  • set auto_install to True

In this way, you are guaranteed that your module will be installed, and not uninstallable.

0

精彩评论

暂无评论...
验证码 换一张
取 消