顶部和左侧菜单栏odoo 8

时间:2016-05-11 13:22:26

标签: python-2.7 openerp odoo-8

我是odoo开发的新手。我正在制作一个包含顶级菜单和左侧菜单栏的新页面。 我的控制器是:

@http.route('/test',auth='public')
def index(self,**kw):
    return http.request.render('test.index',{})

我的模板有:

<template id="index">
   *** I want to call or inherit template with top menu item and left menu bar
   <div class="body">
       My test body data
   </div>
</template>

我也尝试使用但是这使用了我不想要的网站插件,我只需要显示顶部和左侧菜单栏,我的内容位于中心。

你能帮我吗? 真的很感激。

谢谢,

1 个答案:

答案 0 :(得分:1)

您必须使用网站布局来为您提供整个页面结构,例如:

<template name="My template" id="my_template">
  <t t-call="website.layout">
    <div id="wrap">
      <div class="container">
        [...]
      </div>
    </div>
  </t>
</template>

通过这样做,您将以网站布局here注入页面内容。

如果您只想显示布局的某些部分,请覆盖布局以创建自己的布局,而不是调用website.layout,而是调用自定义版本。

相关问题