Odoo Help


How to get database name in webclient_templates.xml?

on 2/4/15, 5:47 AM 1,011 views

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'/>
<!-- Irrelevant code -->

With kind regards



| 6 5 7
Lodz, Poland

On 2/4/15, 8:27 AM

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)

on 2/4/15, 8:39 AM

Thank you very much Zbik! Accepted & upvoted :)

on 2/4/15, 9:27 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


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

2 follower(s)


Asked: 2/4/15, 5:47 AM
Seen: 1011 times
Last updated: 3/16/15, 8:10 AM