Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet

Hello!

Im tryin to add some info in the ControlPanel only for the list(tree) view, but im not really able to do, im understand that the Template is called in base.xml 


in base.xml where

 t t-name="ControlPanel">

|____> here i like to have avaible some aditional variables wich store some data produced here or in the file "control_panel.js" 

in "control_panel.js"

odoo.define('web.ControlPanel', function (require) {

"use strict";


var Bus = require('web.Bus');

var data = require('web.data');

var Widget = require('web.Widget');


console.log('hello, initializing control panel '+window.location.href); //i add this but dont know how send this string (current URL in window.location.href) to base.xml

 

var lista = false;  //i set this var "lista" but dont exist in base.xml after

if(window.location.href.search('view_type=list')>-1){lista = true};


var ControlPanel = Widget.extend({

    template: 'ControlPanel',

​//after i add here the var but dont get it in base.xml neither.


please i need two hands, because im not sure about how send  a variable how tell over here, 
but i need understand to how can in the .js file (or even in the base.xml) read other model and get some data from there

Thank a lot for read!

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juni 24
3482
0
Mai 23
1279
1
Jan. 21
12030
1
März 15
4537
0
Juli 25
434