Skip to Content
Menu
This question has been flagged
1 Reply
2059 Views

hi,

I working on the dashboard using JS template, the XML template is not loading I get a screen with three block. 

here's the javascript code :


odoo.define('hr_dashboard.Dashboard', function (require) {
"use strict";

var AbstractAction = require('web.AbstractAction');
var core = require('web.core');
var Dashboard = AbstractAction.extend({
template: 'DashboardMain',
});

core.action_registry.add('custom_hr_dashboard', Dashboard);

return Dashboard;
});

here's the xml:






Hello odoo


this my first dashboard






here's xml view files which load the JS template:



HR Dashboard
custom_hr_dashboard


name=" Hr Dashboard"
action="hr_dashboard_action"
sequence="-200"/>





























Avatar
Discard
Best Answer

Hi,

You can use following code as example for your custom dashboard 

JavaScript

odoo.define('hrms_dashboard.DashboardRewrite', function(require) {
"use strict";
var AbstractAction = require('web.AbstractAction');
var HrDashboard = AbstractAction.extend({
template: 'DashboardMain',
});

Views

<menuitem id="menu_hrms_dashboard" name="Dashboard" action="hr_action_dashboard


          sequence=" -100" groups="base.group_user" />


<record id="hr_action_dashboard" model="ir.actions.client">


Template





<template id="template" xml:space="preserve">


    <t t-name="DashboardMain">


        <div class="oh_dashboards">


            <div class="container-fluid o_hr_dashboard">


            </div>


        </div>


    </t>


</template>




Hope it helps


Avatar
Discard
Related Posts Replies Views Activity
0
Mar 24
275
0
Oct 22
1518
0
Sep 22
664
1
Jul 22
4087
0
Jun 22
836