Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
3933 มุมมอง

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..