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

Hi guys

I would love to add the database name right above the company logo in my Odoo.
The code that shows the image is coded in the template web.menu_secondary under web/views/webclient_templates.xml.
I now want to print the database name here so the user can always see which exact database he is in.
I've 'coded' the place where it should come but now I don't know how to get the database name from here. Is there any way to access it from here?
My code:

<template id="web.menu_secondary">
            <a class="oe_logo" t-att-href="'/web/?debug' if debug else '/web'">
                <span class="oe_logo_edit">Edit Company data</span>
        Database: <!--The db name should be printed here.. -->
                <img src='/web/binary/company_logo'/>
            </a>
            <div>
<!-- Irrelevant code -->
</template>

With kind regards
Yenthe

아바타
취소
베스트 답변

Try this, database name:

 <t t-esc="request.db"/>

and company name:

<span t-esc="user_id.company_id.name"/>

아바타
취소
작성자

Awesome, works like a charm! Is there also a way to get the company name in this template? (I'll accept & upvote it after this)

작성자

Thank you very much Zbik! Accepted & upvoted :)