Skip to Content
Menu
This question has been flagged
2 Replies
1060 Views

I want to make changes on the database selector web page, how can I do it?

any help plz ....?

Avatar
Discard
Author Best Answer

It made all content page invisible after i did render my template i want to make changes like change favicon

Avatar
Discard
Best Answer

Hi,

Try the following code.

from odoo.addons.web.controllers.main import Database, db_list

class restrict_Database(Database):

def _is_user_admin(self):

uid=request.session.uid
cr=request.cr
context=request.context

# Admin user allowed
if uid==SUPERUSER_ID:
return True

# Get technical features group
data_obj=request.registry['ir.model.data']
admin_group_id=data_obj.search(cr, SUPERUSER_ID, [('model','=','res.groups' ),('name','=','group_no_one')], context=context)
if admin_group_id:

# Check if user belongs to group technical features
groups_obj=request.registry['res.groups']
user_id=groups_obj.search(cr, SUPERUSER_ID, [('id','=',admin_group_id[0]), ('users','in', [uid])], context=context)

return user_id and True or False


return False

# sample for the manager route, we can create the route for the create, delete, and all other manager options


@http.route('/web/database/manager', type='http', auth="none")
def manager(self, **kw):

# Check if admin group
if self._is_user_admin():
# If admin group, call parent class method
return super(restrict_Database, self).manager(**kw)

# If not admin group, error page
else:
return env.get_template("template_value").render({'conditions})

Regards

Avatar
Discard