콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
1269 화면

i want to be able to remove or add the controlpanel to some kanban view ,how can i do that?

아바타
취소
베스트 답변

Hi,

By using patching method, we can modify the control panel in Odoo.Use the following code to add or remove the control panel in Odoo:/** @odoo-module */


import { ControlPanel } from "@web/search/control_panel/control_panel";

import { patch } from "@web/core/utils/patch";

import { useRef, onPatched, onMounted, useState } from "@odoo/owl";


patch(ControlPanel.prototype,{

    setup() {

        super.setup();

        onMounted(() => {            #you can specify the condition where we need to hide the control panel

            if (this.env.searchModel && this.env.searchModel.resModel == 'your_model') {

                this.root.el.style.setProperty("display", "none", "important");

            }

        });

    },

});


Hope it helps.

아바타
취소