繁体   English   中英

如何在保存模式下打开向导操作也隐藏编辑、创建、保存和放弃按钮 Odoo11

[英]How to open wizard action in save mode also hide edit,create,save & discard button Odoo11

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

我的代码如下:

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>

谢谢大家。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM