Hi! I'm new in the forums, this is my first post. I have been working as an Odoo technical developer for the last six months and it's a huge pleasure to be part of this awesome community. My name is Max, I'm from Argentina.
Right now I am trying to get a tree view (in Odoo 15) to stop sorting when its headers are clicked. So far I have tried this:
odoo.define('production_operator_missiongroup.custom_list_renderer', function (require) { "use strict";
console.log("Javascript works!")
var ListRenderer = require('web.ListRenderer');
var CustomListRenderer = ListRenderer.extend({
events: _.extend({}, ListRenderer.prototype.events, {
'click thead th.o_column_sortable': '_onSortColumn',
}),
_onSortColumn: function (ev) {
var viewId = 'production_operator_missiongroup.view_production_work_tree_operator';
if (this.state && this.state.id === viewId) {
ev.preventDefault();
return false;
}
return this._super.apply(this, arguments);
},
});
return CustomListRenderer;});
But that view is still getting sorted /sigh/. This .js file was successfully imported and that log is being logged. I would be veery grateful for some help with this, the Javascript framework is still a huge weak spot in my Odoo knowledge and can barely grasp it.