Odoo Help

18
28
Avatar

Guewen Baconnier

--Guewen Baconnier--

2936
| 6 7 8
Lausanne, Switzerland
--Guewen Baconnier--

Guewen works at Camptocamp as an Odoo developer since 2010. He is the lead developer of the Odoo Connector framework and the Magento Connector. He is a delegate member of the OCA, a committer and an active contributor to the OCA projects.

 

Guewen Baconnier
On 2/21/13, 5:40 AM

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

Maxime Chambreuil
on 4/27/13, 3:06 PM

thx ,it help me great

dengwei
on 12/25/13, 11:54 PM

great answer, thanks for the help

exxor
on 2/6/14, 8:49 AM

Should be this to avoid a change in the formatting.

    <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>
Savoir-Faire Linux, Sandy Carter
on 2/20/14, 4:07 PM

Thanks Sandy. Edited my answer.

Camptocamp Group, Guewen Baconnier
on 2/21/14, 5:45 AM
8
Andrey Kolpakov
On 4/1/14, 12:17 PM

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.

Very nice , Working fine

Atul Kumar jain
on 8/13/14, 11:06 AM

I like your approach! Added security is very important.

Kelly Stuart
on 10/30/14, 12:30 AM
3
Avatar

Daniel Reis

--Daniel Reis--
3616
| 7 8 9
Linda-a-Velha, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


Daniel Reis
On 2/21/13, 5:30 AM

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.

In my updated 7.0 code, this option just removes the database selection box.

Mohammad Alhashash
on 2/21/13, 5:52 AM

To remove database list NOT "manage databases" can be from the openerp configuration file located at /etc/openerp/openerp-server.conf on list_db option.

Wira Bakti Soenaryo
on 2/21/13, 10:54 PM

With this option, clicking on the link does nothing anyway, so it works fine for security purposes.

thenon
on 4/4/13, 2:56 PM
1
Angela
On 2/21/13, 5:06 AM

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

The XML File is located at /addons/web/static/src/xml. This should definitely be configurable in the main conf file, requiring neither module nor hack.

John Karr
on 12/7/13, 12:06 AM
-1
Marek Toman
On 4/24/13, 5:46 AM

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.

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

7 follower(s)

Stats

Asked: 2/21/13, 4:41 AM
Seen: 44841 times
Last updated: 9/23/16, 10:01 AM