Browse Source

[FIX] OCA remarks

pull/450/head
David Beal 9 years ago
parent
commit
c5741a6154
  1. 2
      secure_uninstall/README.md
  2. 2
      secure_uninstall/__openerp__.py
  3. 10
      secure_uninstall/module.py

2
secure_uninstall/README.md

@ -1,5 +1,5 @@
Secure Uninstall Secure Uninstall
================ ================
Ask admin password ('admin_passwd' key from config file)
Ask Master Password ('admin_passwd' key from config file)
before to proceed to module uninstallation before to proceed to module uninstallation

2
secure_uninstall/__openerp__.py

@ -33,7 +33,7 @@
Secure Uninstall Secure Uninstall
================ ================
Ask admin password ('admin_passwd' key from config file)
Ask Master Password ('admin_passwd' key from config file)
before to proceed to module uninstallation before to proceed to module uninstallation

10
secure_uninstall/module.py

@ -27,9 +27,9 @@ class Module(orm.Model):
_inherit = 'ir.module.module' _inherit = 'ir.module.module'
def button_uninstall(self, cr, uid, ids, context=None): def button_uninstall(self, cr, uid, ids, context=None):
if 'uninstall_authorized' in context:
if not context: if not context:
context = {} context = {}
if 'uninstall_authorized' in context:
ctx = context.copy() ctx = context.copy()
del ctx['uninstall_authorized'] del ctx['uninstall_authorized']
super(Module, self).button_uninstall( super(Module, self).button_uninstall(
@ -56,7 +56,8 @@ class UninstallCheckWizard(orm.TransientModel):
_columns = { _columns = {
'password': fields.char( 'password': fields.char(
string='Password', required=True, string='Password', required=True,
help="'admin_passwd' value from Odoo configuration file")
help="'admin_passwd' value from Odoo configuration file "
"(aka 'Master Password')")
} }
def check_password(self, cr, uid, ids, context=None): def check_password(self, cr, uid, ids, context=None):
@ -65,14 +66,15 @@ class UninstallCheckWizard(orm.TransientModel):
if not config_passwd: if not config_passwd:
raise orm.except_orm( raise orm.except_orm(
'Missing configuration key', 'Missing configuration key',
"'admin_passwd' configuration key is not set in "
"'admin_passwd' configuration key "
"(aka 'Master Password') is not set in \n"
"your Odoo server configuration file: " "your Odoo server configuration file: "
"please set it a value") "please set it a value")
if elm.password != config_passwd: if elm.password != config_passwd:
raise orm.except_orm( raise orm.except_orm(
"Password Error", "Password Error",
"Issue\n_____\nProvided password '%s' doesn't match with " "Issue\n_____\nProvided password '%s' doesn't match with "
"'admin_passwd' found in the "
"'Master Password' ('admin_passwd' key) found in the "
"Odoo server configuration file ." "Odoo server configuration file ."
"\n\nResolution\n__________\n" "\n\nResolution\n__________\n"
"Please check your password and retry or cancel" "Please check your password and retry or cancel"

Loading…
Cancel
Save