我想在日历的摘要窗口中打开直接表单 View 。那么,如何在点击日历 View 时打开直接窗体 View 呢?
我使用 web_calendar 模块 (widgets.js 文件) 作为引用。
我尝试了以下代码:
var self = this;
this._super(parent, {
title: this.get_title(),
size: 'small',
buttons: this._buttons ? [
{text: _t("Create"), classes: 'btn-primary', click: function () {
if (!self.quick_add()) {
self.focus();
}
}},
{text: _t("Edit"), click: function () {
self.slow_add();
}},
{text: _t("Cancel"), close: true},
] : [],
$content: QWeb.render('CalendarView.quick_create', {widged: this})
});
最佳答案
我在 Odoo 11 上,要从日历直接转到没有摘要窗口的表单 View ,我唯一要做的就是在 xml 日历标签中设置属性 quick_add="False"。我可以想象这也适用于早期的 Odoo 版本,但我不知道。
<field name="arch" type="xml">
<calendar ... quick_add="False">
<field name="name"/>
</calendar>
</field>
关于javascript - 直接打开表单 View 窗口而不是日历 Odoo 10 上的摘要窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50460602/