Ir al contenido
Menú
Se marcó esta pregunta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 24
3482
0
may 23
1280
1
ene 21
12032
1
mar 15
4537
0
jul 25
435