Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

[solved] How tho remove ControlPanel from a specific view ?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
filterviewsearchbarodoo13CE
4 Besvarelser
9596 Visninger
Avatar
niconep

Hello,


I created a custom kanban view and I want to hide the control panel (header) from this view onl.


What would be the best way to do this ?


Thanks !

0
Avatar
Kassér
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Bedste svar

Hi,


By using patching method, we can modify the control panel in Odoo. For that, use the following code:

/** @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 for which view you need to remove the control panel

            if (this.env.searchModel.vew == 'form') {

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

            }

        });

    },

});



Hope it helps.

0
Avatar
Kassér
Avatar
ccfuns
Bedste svar

The structure of withControlPanel is wrong,

You should write like this : 

var KanbanViewWithoutControlPanel = KanbanView.extend({

withControlPanel: false

});


You can find the structure of related parameters from this path :

/odoo/addons/web/static/src/js/views/abstract_view.js

0
Avatar
Kassér
Avatar
niconep
Forfatter Bedste svar

Ravi,

Thank you for your answser and pointing out the correct documentation.

Unfortunately it does not work : the control panel is still there. Here's what I'm doing 

odoo.define('my.KanbanViewWithoutControlPanel', function (require) {
"use strict";

var viewRegistry = require('web.view_registry')
var KanbanView = require('web.KanbanView')

var KanbanViewWithoutControlPanel = KanbanView.extend({
config: _.extend({}, KanbanView.prototype.config, {
withControlPanel: false,
}),
});

viewRegistry.add('kanban_without_control_panel', KanbanViewWithoutControlPanel)
});


And in my view

<kanban js_class="kanban_without_control_panel">...

There is no error. The js file is correctly loaded.


I modified the JS to print out the current view in the console .



        init: function (viewInfo, params) {
this._super.apply(this, arguments);
console.log(this)
},


The output shows that the view is called, but the control panel is still enabled:


arch: {…}
​​
attrs: {…}
​​​
​​​
create: "false"
​​​
js_class: "kanban_homepage"
...
withControlPanel: true
​
withSearchPanel: true


So ma temporary solution (wrong ?) is to set this 2 variables in the init method.


Regards

0
Avatar
Kassér
Ravi Gadhia

Hi

is it solved?

Avatar
Ravi Gadhia
Bedste svar



extend kanban view using "js_class" attribute (https://www.odoo.com/documentation/13.0/reference/javascript_cheatsheet.html#customizing-an-existing-view)

override  withControlPanel to false

var KanbanViewWithoutControlPanel = kanbanView.extend({
config: _.extend({}, kanbanView.prototype.config, {
        // determines if a control panel should be instantiated
        withControlPanel: false,
        // determines if a search panel could be instantiated
        // withSearchPanel: false,
    }),
});

viewRegistry.add('kanban_without_control_panel', KanbanViewWithoutControlPanel);
<kanban js_class="kanban_without_control_panel">
0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Filter by attribute of an attribute on a view
filter view active_id
Avatar
0
dec. 16
4578
Error when using custom 'GROUP BY' filter
filter view custom module
Avatar
0
mar. 15
7537
Add a filter to an existing tree view Løst
filter v8 view
Avatar
Avatar
1
mar. 15
19510
Search Bar Filter Customization
filter xml searchview searchbar
Avatar
0
nov. 24
1280
How to apply a custom filter with a button press
action filter calendar view
Avatar
1
dec. 23
8089
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now