[IMP] kpi_dashboard: Allow installation with EE

This commit is contained in:
Enric Tobella
2023-05-09 09:39:20 +02:00
parent 47bb1cdd99
commit ce4aa39c2c
12 changed files with 48 additions and 16 deletions

View File

@@ -67,7 +67,7 @@ odoo.define("kpi_dashboard.DashboardController", function (require) {
action_id: action,
context_to_save: {res_id: self.initialState.res_id},
domain: [("id", "=", self.initialState.res_id)],
view_mode: "dashboard",
view_mode: "kpi_dashboard",
name: name,
},
})
@@ -88,7 +88,7 @@ odoo.define("kpi_dashboard.DashboardController", function (require) {
// HOOK Function
this.$buttons.on(
"click",
".o_dashboard_button_add",
".o_kpi_dashboard_button_add",
this._addDashboard.bind(this)
);
},

View File

@@ -7,7 +7,7 @@ odoo.define("kpi_dashboard.DashboardRenderer", function (require) {
var qweb = core.qweb;
var DashboardRenderer = BasicRenderer.extend({
className: "o_dashboard_view",
className: "o_kpi_dashboard_view",
_getDashboardWidget: function (kpi) {
var Widget = registry.getAny([kpi.widget, "abstract"]);
var widget = new Widget(this, kpi);

View File

@@ -14,9 +14,9 @@ odoo.define("kpi_dashboard.DashboardView", function (require) {
jsLibs: ["/kpi_dashboard/static/lib/gridster/jquery.dsmorse-gridster.min.js"],
cssLibs: ["/kpi_dashboard/static/lib/gridster/jquery.dsmorse-gridster.min.css"],
accesskey: "d",
display_name: _lt("Dashboard"),
display_name: _lt("KPI Dashboard"),
icon: "fa-tachometer",
viewType: "dashboard",
viewType: "kpi_dashboard",
config: _.extend({}, BasicView.prototype.config, {
Controller: DashboardController,
Renderer: DashboardRenderer,
@@ -34,7 +34,7 @@ odoo.define("kpi_dashboard.DashboardView", function (require) {
},
});
view_registry.add("dashboard", DashboardView);
view_registry.add("kpi_dashboard", DashboardView);
return DashboardView;
});

View File

@@ -10,7 +10,7 @@ odoo.define("kpi_dashboard.KpiFieldWidget", function (require) {
var KpiFieldWidget = basic_fields.FieldChar.extend({
jsLibs: ["/kpi_dashboard/static/lib/gridster/jquery.dsmorse-gridster.min.js"],
cssLibs: ["/kpi_dashboard/static/lib/gridster/jquery.dsmorse-gridster.min.css"],
className: "o_dashboard_view",
className: "o_kpi_dashboard_view",
_renderReadonly: function () {
this.$el.html($(qweb.render("dashboard_kpi.dashboard")));
var marginx = 0;

View File

@@ -1,4 +1,4 @@
.o_dashboard_view {
.o_kpi_dashboard_view {
height: 100%;
@include o-webclient-padding(
$top: $o-horizontal-padding/2,

View File

@@ -84,10 +84,10 @@
</t>
</t>
<t t-name="kpi_dashboard.buttons">
<div class="o_dashboard_buttons" role="toolbar" aria-label="Main actions">
<div class="o_kpi_dashboard_buttons" role="toolbar" aria-label="Main actions">
<button
type="button"
class="btn btn-primary o_dashboard_button_add"
class="btn btn-primary o_kpi_dashboard_button_add"
accesskey="d"
>
Add to Dashboard