Javascript 如何在保存模式下打开向导操作还隐藏编辑、创建、保存&;丢弃按钮Odoo11

Javascript 如何在保存模式下打开向导操作还隐藏编辑、创建、保存&;丢弃按钮Odoo11,javascript,save,odoo,odoo-11,Javascript,Save,Odoo,Odoo 11,当我点击按钮时,向导将以“编辑”模式打开。我想在“保存”模式下打开向导,还想隐藏按钮页脚(创建、编辑、保存和放弃)。那么,有人建议我解决这个问题吗 我的代码如下: o_button_help: function(){ var self = this; event.stopPropagation(); event.preventDefault(); rpc.query({ model: 'timesheet.help', method

当我点击按钮时,向导将以“编辑”模式打开。我想在“保存”模式下打开向导,还想隐藏按钮页脚(创建、编辑、保存和放弃)。那么,有人建议我解决这个问题吗

我的代码如下:

o_button_help: function(){
    var self = this;
    event.stopPropagation();
    event.preventDefault();
    rpc.query({
        model: 'timesheet.help',
        method: 'get_timesheet_help_document',
        args: [],
    }).then(function (res) {
        test = res['timesheet_document_view_id'];
        self.do_action({
            name: ("Help"),
            type: 'ir.actions.act_window',
            res_model: 'document.document',
            view_mode: 'form,tree,kanban',
            view_type: 'form',
            views: [[false, 'form'],[false, 'list'],[false, 'kanban']],
            target: 'new',
            res_id: test,
        },{on_reverse_breadcrumb: function(){ return self.reload();}})
    });
同时附上屏幕截图:
提前感谢

通过jquery在操作中应用标志和隐藏按钮解决了问题:

o_button_help: function(){
    var self = this;
    event.stopPropagation();
    event.preventDefault();
    rpc.query({
        model: 'timesheet.help',
        method: 'get_timesheet_help_document',
        args: [],
    }).then(function (res) {
        test = res['timesheet_document_view_id'];
        self.do_action({
            name: ("Help"),
            type: 'ir.actions.act_window',
            res_model: 'document.document',
            view_mode: 'form,tree,kanban',
            view_type: 'form',
            views: [[false, 'form'],[false, 'list'],[false, 'kanban']],
            target: 'new',
            res_id: test,
        flags: {'form': {'mode': 'readonly', 'initial_mode': 'readonly'}},
        },{on_reverse_breadcrumb: function(){ return self.reload();}})
    });
<form class="o_form_document">
                    <script>
                        $(document).ready(function(){
                        $(".modal-header").hide();
                        $(".modal-footer").hide();
                        });
                    </script>
...
</form>
o_按钮帮助:函数(){
var self=这个;
event.stopPropagation();
event.preventDefault();
rpc.query({
模型:“时间表.帮助”,
方法:“获取时间表帮助文档”,
args:[],
}).然后(功能(res){
test=res['timesheet\u document\u view\u id'];
自我行动({
姓名:(“帮助”),
键入:“ir.actions.act\u窗口”,
res_模型:“document.document”,
视图模式:“表单、树、看板”,
视图类型:“表单”,
视图:[[false,'form'],[false,'list'],[false,'kanban'],
目标:"新",,
res_id:test,
标志:{'form':{'mode':'readonly','initial_mode':'readonly'},
},{on_reverse_breadcrumb:function(){return self.reload();}})
});
$(文档).ready(函数(){
$(“.modal头”).hide();
$(“.modal footer”).hide();
});
...
谢谢大家