首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在网站odoo 8中弹出

在网站odoo 8中弹出
EN

Stack Overflow用户
提问于 2016-07-15 17:22:19
回答 1查看 825关注 0票数 0

当我点击“点击此处编辑”链接时,我需要打开一个弹出窗口。

我尝试了下面的代码

代码语言:javascript
运行
复制
@http.route(['/ftp_server/web/edit_dir/'], type='http', auth="public", website=True)
def edit_dir(self, **kwargs):
    cr, uid, context, pool = request.cr, request.uid, request.context, request.registry
    print'ftp_server_kwargs', kwargs

    values = {}
    return request.website.render("website.contentMenu.dialog.edit", values)

但是得到了一个错误:

代码语言:javascript
运行
复制
ValueError: External ID not found in the system: website.contentMenu.dialog.edit

我正在尝试在网站上编辑菜单。

EN

回答 1

Stack Overflow用户

发布于 2016-07-17 03:24:31

您需要您的弹出窗口有一个id为“编辑”的模板,只有当弹出窗口是模块"website.contentMenu.dialog“的一部分时,它才会起作用。

表单为:

代码语言:javascript
运行
复制
request.website.render("modulename.templateid", {
 'data_sent_to_template': data_generated_in_controller
}
代码语言:javascript
运行
复制
<template id="templateid">
   //pop up html
</template>

http://www.odoo.com/documentation/9.0/howtos/website.html#templates

通常,在这种情况下,我更喜欢在页面中用html构建弹出窗口,使用jquery显示和隐藏,使用Ajax将其发送到控制器并从中获取数据,而不使用python呈现数据。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38392450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档