mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] kpi_dashboard: Migration to 15.0
This commit is contained in:
committed by
Brian McMaster
parent
d967e0d929
commit
b376049f77
@@ -3,9 +3,8 @@
|
||||
|
||||
{
|
||||
"name": "Kpi Dashboard",
|
||||
"summary": """
|
||||
Create Dashboards using kpis""",
|
||||
"version": "14.0.1.2.1",
|
||||
"summary": """Create Dashboards using kpis""",
|
||||
"version": "15.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Creu Blanca,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/reporting-engine",
|
||||
@@ -15,11 +14,31 @@
|
||||
"wizards/kpi_dashboard_menu.xml",
|
||||
"security/security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"templates/assets.xml",
|
||||
"views/kpi_menu.xml",
|
||||
"views/kpi_kpi.xml",
|
||||
"views/kpi_dashboard.xml",
|
||||
],
|
||||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"kpi_dashboard/static/src/js/widget_registry.js",
|
||||
"kpi_dashboard/static/src/js/widget/abstract_widget.js",
|
||||
"kpi_dashboard/static/src/js/dashboard_renderer.js",
|
||||
"kpi_dashboard/static/src/js/dashboard_model.js",
|
||||
"kpi_dashboard/static/src/js/dashboard_controller.js",
|
||||
"kpi_dashboard/static/src/js/dashboard_view.js",
|
||||
"kpi_dashboard/static/src/js/widget/integer_widget.js",
|
||||
"kpi_dashboard/static/src/js/widget/number_widget.js",
|
||||
"kpi_dashboard/static/src/js/widget/counter_widget.js",
|
||||
"kpi_dashboard/static/src/js/widget/meter_widget.js",
|
||||
"kpi_dashboard/static/src/js/widget/graph_widget.js",
|
||||
"kpi_dashboard/static/src/js/widget/text_widget.js",
|
||||
"kpi_dashboard/static/src/js/field_widget.js",
|
||||
"kpi_dashboard/static/src/scss/kpi_dashboard.scss",
|
||||
],
|
||||
"web.assets_qweb": [
|
||||
"kpi_dashboard/static/src/xml/**/*",
|
||||
],
|
||||
},
|
||||
"demo": ["demo/demo_dashboard.xml"],
|
||||
"maintainers": ["etobella"],
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# Copyright 2023 CreuBlanca
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
from openupgradelib import openupgrade
|
||||
|
||||
|
||||
@openupgrade.migrate()
|
||||
def migrate(env, version):
|
||||
"""We need to do the changes on pre-migration in order to avoid cascades"""
|
||||
openupgrade.logged_query(
|
||||
env.cr,
|
||||
"""
|
||||
UPDATE ir_ui_view as iuv
|
||||
SET type = 'kpi_dashboard'
|
||||
FROM ir_model_data as imd
|
||||
WHERE
|
||||
iuv.id = imd.res_id
|
||||
AND imd.module = 'kpi_dashboard'
|
||||
AND imd.name = 'kpi_dashboard_dashboard_view'
|
||||
""",
|
||||
)
|
||||
openupgrade.logged_query(
|
||||
env.cr,
|
||||
"""
|
||||
UPDATE ir_act_window
|
||||
SET view_mode = 'kpi_dashboard'
|
||||
WHERE view_mode = 'dashboard' AND res_model = 'kpi.dashboard'
|
||||
""",
|
||||
)
|
||||
@@ -55,7 +55,7 @@ class KpiKpi(models.Model):
|
||||
inverse_name="kpi_id",
|
||||
help="Actions that can be opened from the KPI",
|
||||
)
|
||||
code = fields.Text("Code")
|
||||
code = fields.Text()
|
||||
store_history = fields.Boolean()
|
||||
store_history_interval = fields.Selection(
|
||||
selection=lambda self: self.env["ir.cron"]._fields["interval_type"].selection,
|
||||
@@ -122,9 +122,11 @@ class KpiKpi(models.Model):
|
||||
notifications = []
|
||||
for dashboard_item in self.dashboard_item_ids:
|
||||
channel = "kpi_dashboard_%s" % dashboard_item.dashboard_id.id
|
||||
notifications.append([channel, dashboard_item._read_dashboard()])
|
||||
notifications.append(
|
||||
[self.env.user, channel, dashboard_item._read_dashboard()]
|
||||
)
|
||||
if notifications:
|
||||
self.env["bus.bus"].sendmany(notifications)
|
||||
self.env["bus.bus"]._sendmany(notifications)
|
||||
|
||||
def _compute_value_function(self):
|
||||
obj = self
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<template
|
||||
id="assets_backend"
|
||||
name="Backend Assets (used in backend interface)"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget_registry.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/abstract_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/dashboard_renderer.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/dashboard_model.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/dashboard_controller.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/dashboard_view.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/integer_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/number_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/counter_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/meter_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/graph_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/widget/text_widget.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/kpi_dashboard/static/src/js/field_widget.js"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/scss"
|
||||
href="/kpi_dashboard/static/src/scss/kpi_dashboard.scss"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user