簡體   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