I try to call a JS function from my qweb inherited template via:
<tr t-extend="ListView.row">
<t t-jquery="td" t-operation="replace">
[...]
<t t-set="test" t-value="value_check(column.id, record.get(column.id))"/>
But I allways get the Error:
Error: QWeb2 - template['ListView.rows']:
Runtime Error: Error: QWeb2 - template['ListView.row']:
Runtime Error: TypeError: dict.value_check is not a function
without the function call the extended template works fine. So the JS function cannot be found. First I tried this JS code for my function:
openerp.my_module = function(instance){
var module = instance.web // loading the namespace of the 'sample' module
module.View.include({
value_check: function(key, value){
console.log(key + ": " + value);
return true;
},
});
};
and then also
openerp.my_module = function(instance){
var module = instance.web; // loading the namespace of the 'sample' module
var _super_ = module.View.prototype.value_check;
module.View.prototype.value_check = function(key, value){
console.log(key +': '+value);
_super_.call(this);
return true;
};
};
any suggestions? Could it be its because of the inherited tempate? But I can call stuff like render_cell from the web module js. It even doesn't work if I put the check_value into the view_list.js of the web module.