İçereği Atla
Menü
Bu soru işaretlendi

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Haz 24
3480
0
May 23
1279
1
Oca 21
12028
1
Mar 15
4536
0
Tem 25
433