I have attempted to extract HTML content from JavaScript declared in my module.
However, when I try to retrieve content by class name, all I can access is the header contents and not the kanban view.
openerp.my_module = function(instance) {
var header = $(".headerClass").html();
console.log(header);
var kanban = $(".kanbanClass").html();
console.log(kanban);
};
I have also added the JavaScript file to web.assets_backend.
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/my_module/static/src/js/my_module.js"></script>
</xpath>
</template>
</data>
</openerp>
The first log displays the HTML contents, but the second log shows "undefined."
It seems that when this JavaScript is executed, the kanban view in XML is not included.
UPDATE
<record id="my_module_view_kanban" model="ir.ui.view">
<field name="name">my.module.kanban</field>
<field name="model">my.module.model</field>
<field name="arch" type="xml">
<kanban class="oe_background_grey o_kanban_dashboard" display="[name]">
<field name="name"/>
<field name="color"/>
<field name="state"/>
<field name="nth_week"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="date"/>
<field name="count_employees"/>
<templates>
<t t-name="kanban-box">
<div class="kanban_weekly_record">
<div t-attf-class="#{kanban_color(record.color.raw_value)} oe_kanban_global_click">
<div class="o_weekly_kanban_main">
<div class="o_kanban_card_content o_visible">
<div class="o_kanban_primary_left">
<div class="o_kanban_primary_left">
<div class="o_primary weekly">
<span>
<div class="kanbanClass">
<t t-esc="record.field.value"/>
</div>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
<template>
</kanban>
</field>
</record>
Furthermore, I receive "undefined" when logging with the o_kanban_primary_left class.