简体   繁体   中英

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

When I'm clicking on button then wizard open in 'edit' mode. I want to open wizard in 'save' mode also want to hide button footer(create, edit, save & discard). So, Anyone suggests me the solution for this problem?

My code is below:

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();}})
    });

Also attaching Screenshot: 在此处输入图片说明 Thanks in advance

Problem solved by applying flags in action and hide button by 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>

Thanks to all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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