Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
735 Переглядів

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!

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
черв. 24
3482
0
трав. 23
1281
1
січ. 21
12033
1
бер. 15
4537
0
лип. 25
435