跳至内容
菜单
此问题已终结
5 回复
3965 查看

Hi,
I want to check database name in qweb template odoo 10, how I can get it, please help if anyone know.

形象
丢弃

Hi Nalini,

in Which Qweb Template you need Database name ?

编写者

I have added 1 report for printing journal entry .. in that I want to fetch database name. But i don't know how we can get it in template.

最佳答案

Hello Nalini

You can try with following code in qweb report.

<t t-esc='doc.env.cr.dbname'/>

correct me if i am wrong !

Thank you 

形象
丢弃
编写者

Yes it helped.. Thanks alot

最佳答案

Hi Nalini,

In Normal we can use this method for find database name

self.env.cr.dbname

for qweb replace self by request

 <t t-esc='request.env.cr.dbname'/>

形象
丢弃
编写者

Thanks a lot.. it helped me..