콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1658 화면

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

any help plz ....?

아바타
취소
작성자 베스트 답변

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

아바타
취소
베스트 답변

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

아바타
취소