Hey everyone,
I am trying to understand Javascript in Odoo 11 because I want to colorize the Kanban cards based on a field holding rgba values.
I have gotten this far:
odoo.define('project_show_milestone.kanban_milestone_color', function(require){
"use strict";
var KanbanRecord = require('web.KanbanRecord');
KanbanRecord.include({
renderElement: function () {
this._super.apply(this, arguments);
if (this.recordData['ms_color'] != false) {
//Apply the color to the record, if there is one.
this.$el.find('.oe_kanban_card').css("background-color", this.recordData['ms_color'] || 'green');
var core = require('web.core'); alert(core._t(this.recordData['ms_color']));
}
}
});
});
The alert message, showing the field value executes fine, but the background-color is not applied.
I have no idea why...?
Could you please help me out.
Thanks in advance.
Edited for readability.