Hello,
As my subject, how do we remove the "Manage Databases" link on the login screen? Currently using openerp Version 7.0-20130221-002146 And also can we edit the login screen interface? For example editing the logo image. Thank you..
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
As my subject, how do we remove the "Manage Databases" link on the login screen? Currently using openerp Version 7.0-20130221-002146 And also can we edit the login screen interface? For example editing the logo image. Thank you..
The OpenERP files (server, addons, web) should never be edited. You should always prefer to do your modifications in a custom addon.
You can do this change by creating a custom addon and replacing the part of the UI you don't want.
Usual addons are installed on a database basis. Removing the Manage database
link is global to an installation, so you'll need to start your server with the name of your module in the --load
option.
./openerp-server --load=web,your_module
Your module should also be auto-installable, use the key auto_install
in the __openerp__.py
of your module:
'auto_install': True,
To remove the Manage database
, you'll need to create a file static/src/xml/base.xml
:
<templates>
<!-- Templates modified at the web start, before loading of a database. -->
<!-- Remove the Manage database link, but keep the Powered by OpenERP-->
<t t-extend="Login">
<t t-jquery="div.oe_login_footer" t-operation="replace">
<div class="oe_login_footer">
<a href="http://www.openerp.com" target="_blank">Powered by <span>OpenERP</span></a>
</div>
</t>
</t>
</templates>
Then you need to load the file in __openerp__.py
:
'qweb' : [
"static/src/xml/base.xml",
],
You can edit the logo or other elements interface too.
You can refer to the file addons/web/static/src/xml/base.xml
in openerp-web
to see the base templates.
The templates use the QWeb syntax: QWeb documentation
and there is a great project on Launchpad to host your new module: https://launchpad.net/web-addons
Guewen Baconnier's answer is work. But it only hide the link "Manage Databases". Functionality and API will be still active. And if your OpenERP is public someone can hack your database using this api. Especially if you did not change default password 'admin'.
For restricting access additionally to Guewen Baconnier's comment you should override default controller addons/web/controller/main.py
(Controller Database). For that you should create controller package in your own module and create file <my_own_module>/controller/main.py
with content:
from web import http
from openerp.addons.web.controllers.main import Database, db_list
openerpweb = http
class Database_restrict(Database):
@openerpweb.jsonrequest
def create(self, req, fields):
# check if it is not first installation - restrict!
dblist = db_list(req)
if len(dblist) > 0:
raise Exception('Not allowed')
return super(Database_restrict, self).create(req, fields)
@openerpweb.jsonrequest
def duplicate(self, req, fields):
raise Exception('Not allowed')
@openerpweb.jsonrequest
def drop(self, req, fields):
raise Exception('Not allowed')
@openerpweb.httprequest
def backup(self, req, backup_db, backup_pwd, token):
raise Exception('Not allowed')
@openerpweb.httprequest
def restore(self, req, db_file, restore_pwd, new_db):
raise Exception('Not allowed')
@openerpweb.jsonrequest
def change_password(self, req, fields):
raise Exception('Not allowed')
Then you should include controllers package in __init__.py of your module.
It overrides functions for database management and rase exception but allow you to create first database.
There is a server option for that:
Security-related options:
--no-database-list disable the ability to return the list of databases
Try starting the server adding the option --no-database-list
.
Usual addons are installed on a database basis. Removing the Manage database link is global to an installation, so you'll need to start your server with the name of your module in the --load option.
Tried it without --load option and it works. Just added module in setings page and installed it. Works like charm.
I have all details about this in 6.1.1, I guess it's similar in 7. Do searches in OpenERP 7.0-20130216-002451\Server\server\openerp\addons\web
For example, take a look in base.xml line 81, I'd say if you comment out stuff around there you'd get rid of "Manage database". You can also change the "openerp" link and text to put your own company.
The logos are in web\static\src\img
Hello,
Thank you all for the reply.. I will try all the way above..
Hope this will helps: http://learnopenerp.blogspot.com/2018/09/remove-manage-database-and-powered-by-odoo-from-login-page.html