Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 6 24
3482
0
thg 5 23
1279
1
thg 1 21
12030
1
thg 3 15
4537
0
thg 7 25
434