Here i am upgrading my app v10 to v11
Trying to add colors to list view using get_listview_color() function call in below code.
But Js code not executed till end.
And getting below error in browser console.
error: Some modules could not be started
Failed modules: ["ktree_listview_bgcolor.ListView"]
if any one have solution please response...
JS file code.
odoo.define('ktree_listview_bgcolor.ListView', function (require) {
"use strict";
console.log("dfgfgf");
console.log(5 + 6);
var ListView = require('web.ListView');
var Model = require('web.rpc');
var core = require('web.core');
var Class = core.Class;
var _t = core._t;
var _lt = core._lt;
var QWeb = core.qweb;
alert("Hello! I am an alert box!!"); (Up to here executing )
var ListView1 = ListView.List.include({ (code not executed under this line, if used ListView.include also)
render: function () {
alert("Hello! second I am an alert box!!");
var self = this;
this.$current.html(
QWeb.render('ListView.rows', _.extend({}, this, {
render_cell: function () {
return self.render_cell.apply(self, arguments); }
})));
var list_bg1 = new Model('list.view.theme');
var test = list_bg1.call('get_listview_color',[this.dataset.model]).then(function(result){
self.$current.children('.table-striped > tbody > tr:nth-of-type(odd)').css({'background-color':result['oddrow']});
self.$current.children('.table-striped > tbody > tr:nth-of-type(even)').css({'background-color':result['evenrow']});
});
this.pad_table_to(4);
}
});
});
This is because of the whole JS framework rewrite. Sadly there is no official documentation of it yet (work in progress).