Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
2002 Lượt xem

How do I show the Odoo 8 default top bar menu in my custom routes and custom template?



Here is my code


controllers.py

-------------------------------

import  openerp


class Mymodule(http.Controller):

    @http.route('/mymoduletmp/', auth='public', website=True)

    def index2(self, **kw):

        return http.request.render('mymodule.hellotemplate')





hellotmp.xml

-------------------------------

<openerp>

    <data>

        <template id="hellotemplate">

                <p>Hello Myles9</p>

        </template>

    </data>

</openerp>







Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thank you for the response Niyas Raphy
I tried what you said but I am getting this error  Internal Server Error

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Call the website.layout like this and see,

<template id="hellotemplate">
<t t-call="website.layout">
<p>Hello Myles9</p>
</t>
</template>

Thanks

Ảnh đại diện
Huỷ bỏ