diff --git a/kpi_dashboard_test/README.rst b/kpi_dashboard_test/README.rst deleted file mode 100644 index 591aee8c0..000000000 --- a/kpi_dashboard_test/README.rst +++ /dev/null @@ -1,73 +0,0 @@ -=================== -Kpi Dashboard: Test -=================== - -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! This file is generated by oca-gen-addon-readme !! - !! changes will be overwritten. !! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png - :target: https://odoo-community.org/page/development-status - :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github - :target: https://github.com/OCA/reporting-engine/tree/12.0/kpi_dashboard_test - :alt: OCA/reporting-engine -.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-kpi_dashboard_test - :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/143/12.0 - :alt: Try me on Runbot - -|badge1| |badge2| |badge3| |badge4| |badge5| - -This module is used in order to test KPI Dashboard - -**Table of contents** - -.. contents:: - :local: - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. - -Do not contact contributors directly about support or help with technical issues. - -Credits -======= - -Authors -~~~~~~~ - -* Creu Blanca - -Contributors -~~~~~~~~~~~~ - -* Enric Tobella - -Maintainers -~~~~~~~~~~~ - -This module is maintained by the OCA. - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -This module is part of the `OCA/reporting-engine `_ project on GitHub. - -You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/kpi_dashboard_test/__init__.py b/kpi_dashboard_test/__init__.py deleted file mode 100644 index 0650744f6..000000000 --- a/kpi_dashboard_test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import models diff --git a/kpi_dashboard_test/__manifest__.py b/kpi_dashboard_test/__manifest__.py deleted file mode 100644 index 4e4284ace..000000000 --- a/kpi_dashboard_test/__manifest__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2020 Creu Blanca -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -{ - "name": "Kpi Dashboard: Test", - "summary": """ - Testing KPI dashboard""", - "version": "12.0.1.0.1", - "license": "AGPL-3", - "author": "Creu Blanca,Odoo Community Association (OCA)", - "website": "https://github.com/reporting-engine", - "depends": ["kpi_dashboard"], - "demo": ["demo/demo_dashboard.xml"], -} diff --git a/kpi_dashboard_test/demo/demo_dashboard.xml b/kpi_dashboard_test/demo/demo_dashboard.xml deleted file mode 100644 index 30fc5e861..000000000 --- a/kpi_dashboard_test/demo/demo_dashboard.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - Dashboard - 4 - 50 - 250 - #020202 - - - - Number 01 - $ - function - number - test_demo_number - - - - Number 02 - - function - number - test_demo_number - - - - - - Meter 01 - - function - meter - test_demo_meter - - - - Meter 02 - $ - function - meter - test_demo_meter - - - - - - Graph - function - graph - test_demo_graph - - - - - - - Dashboard title - - 1 - 1 - 4 - #707070 - #000000 - - - - Number 01 - - - 1 - 2 - 4 - #47bbb3 - #ffffff - - - - Number 02 - - - 1 - 6 - 4 - #ec663c - #ffffff - - - - Meter 01 - - - 2 - 2 - 4 - #9c4274 - #ffffff - - - - Meter 02 - - - 2 - 6 - 4 - #12b0c5 - #ffffff - - - - Graph - - - 3 - 2 - 2 - 8 - #ff9618 - #ffffff - - - diff --git a/kpi_dashboard_test/i18n/kpi_dashboard_test.pot b/kpi_dashboard_test/i18n/kpi_dashboard_test.pot deleted file mode 100644 index 1ae7f8bf1..000000000 --- a/kpi_dashboard_test/i18n/kpi_dashboard_test.pot +++ /dev/null @@ -1,20 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * kpi_dashboard_test -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: kpi_dashboard_test -#: model:ir.model,name:kpi_dashboard_test.model_kpi_kpi -msgid "Kpi Kpi" -msgstr "" - diff --git a/kpi_dashboard_test/models/__init__.py b/kpi_dashboard_test/models/__init__.py deleted file mode 100644 index 5bb66de73..000000000 --- a/kpi_dashboard_test/models/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import kpi_kpi diff --git a/kpi_dashboard_test/models/kpi_kpi.py b/kpi_dashboard_test/models/kpi_kpi.py deleted file mode 100644 index f74b04a70..000000000 --- a/kpi_dashboard_test/models/kpi_kpi.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2020 Creu Blanca -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import models -import random - - -class KpiKpi(models.Model): - _inherit = "kpi.kpi" - - def test_demo_number(self): - return { - "value": random.random() * 10000, - "previous": random.random() * 10000, - } - - def test_demo_meter(self): - return { - "min": 0, - "max": 100, - "value": random.random() * 100, - } - - def test_demo_graph(self): - return { - "graphs": [ - { - "values": [ - {"x": i, "y": random.random() * 1000} - for i in range(1, 12) - ], - "title": "Current Year", - "key": "current", - "area": True, - "color": "ffffff", - }, - { - "values": [ - {"x": i, "y": random.random() * 1000} - for i in range(1, 12) - ], - "title": "Previous Year", - "key": "previous", - "area": True, - "color": "000000", - }, - ] - } diff --git a/kpi_dashboard_test/readme/CONTRIBUTORS.rst b/kpi_dashboard_test/readme/CONTRIBUTORS.rst deleted file mode 100644 index 93ec993e0..000000000 --- a/kpi_dashboard_test/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1 +0,0 @@ -* Enric Tobella diff --git a/kpi_dashboard_test/readme/DESCRIPTION.rst b/kpi_dashboard_test/readme/DESCRIPTION.rst deleted file mode 100644 index e9bc1e9d8..000000000 --- a/kpi_dashboard_test/readme/DESCRIPTION.rst +++ /dev/null @@ -1 +0,0 @@ -This module is used in order to test KPI Dashboard diff --git a/kpi_dashboard_test/static/description/icon.png b/kpi_dashboard_test/static/description/icon.png deleted file mode 100644 index 3a0328b51..000000000 Binary files a/kpi_dashboard_test/static/description/icon.png and /dev/null differ diff --git a/kpi_dashboard_test/static/description/index.html b/kpi_dashboard_test/static/description/index.html deleted file mode 100644 index 0af111604..000000000 --- a/kpi_dashboard_test/static/description/index.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - -Kpi Dashboard: Test - - - -
-

Kpi Dashboard: Test

- - -

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runbot

-

This module is used in order to test KPI Dashboard

-

Table of contents

- -
-

Bug Tracker

-

Bugs are tracked on GitHub Issues. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

-

Do not contact contributors directly about support or help with technical issues.

-
-
-

Credits

-
-

Authors

-
    -
  • Creu Blanca
  • -
-
-
-

Contributors

- -
-
-

Maintainers

-

This module is maintained by the OCA.

-Odoo Community Association -

OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use.

-

This module is part of the OCA/reporting-engine project on GitHub.

-

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

-
-
-
- - diff --git a/kpi_dashboard_test/tests/__init__.py b/kpi_dashboard_test/tests/__init__.py deleted file mode 100644 index 7c3e55f24..000000000 --- a/kpi_dashboard_test/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import test_kpi_dashboard diff --git a/kpi_dashboard_test/tests/test_kpi_dashboard.py b/kpi_dashboard_test/tests/test_kpi_dashboard.py deleted file mode 100644 index 571bf859b..000000000 --- a/kpi_dashboard_test/tests/test_kpi_dashboard.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright 2020 Creu Blanca -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo.tests.common import TransactionCase -from odoo.exceptions import ValidationError -from odoo.tests.common import Form - - -class TestKpiDashboard(TransactionCase): - - def setUp(self): - super(TestKpiDashboard, self).setUp() - self.kpi_01 = self.env['kpi.kpi'].create({ - 'name': 'KPI 01', - 'computation_method': 'function', - 'widget': 'number', - 'function': 'test_demo_number' - }) - self.kpi_02 = self.env['kpi.kpi'].create({ - 'name': 'KPI 02', - 'computation_method': 'function', - 'widget': 'number', - 'function': 'test_demo_number' - }) - self.dashboard = self.env['kpi.dashboard'].create({ - 'name': 'Dashboard', - 'number_of_columns': 4, - 'widget_dimension_x': 250, - 'widget_dimension_y': 250, - }) - self.env['kpi.dashboard.item'].create({ - 'dashboard_id': self.dashboard.id, - 'kpi_id': self.kpi_01.id, - 'name': self.kpi_01.name, - 'row': 1, - 'column': 1, - }) - self.env['kpi.dashboard.item'].create({ - 'dashboard_id': self.dashboard.id, - 'name': self.kpi_02.name, - 'kpi_id': self.kpi_02.id, - 'row': 1, - 'column': 2, - }) - self.env['kpi.dashboard.item'].create({ - 'dashboard_id': self.dashboard.id, - 'name': 'TITLE', - 'row': 2, - 'column': 1, - }) - - def test_constrains_01(self): - with self.assertRaises(ValidationError): - self.kpi_01.dashboard_item_ids.write({'size_x': 2}) - - def test_constrains_02(self): - with self.assertRaises(ValidationError): - self.kpi_02.dashboard_item_ids.write({'size_x': 4}) - - def test_constrains_03(self): - with self.assertRaises(ValidationError): - self.kpi_01.dashboard_item_ids.write({'size_y': 11}) - - def test_menu(self): - self.assertFalse(self.dashboard.menu_id) - wzd = self.env['kpi.dashboard.menu'].create({ - 'dashboard_id': self.dashboard.id, - 'menu_id': self.env['ir.ui.menu'].search([], limit=1).id, - }) - wzd.generate_menu() - self.assertTrue(self.dashboard.menu_id) - self.assertFalse(self.dashboard.menu_id.groups_id) - self.dashboard.write({ - 'group_ids': [ - (6, 0, self.env['res.groups'].search([], limit=1).ids)] - }) - self.assertTrue(self.dashboard.menu_id.groups_id) - - def test_onchange(self): - with Form(self.env['kpi.dashboard']) as dashboard: - dashboard.name = 'New Dashboard' - with dashboard.item_ids.new() as item: - item.kpi_id = self.kpi_01 - self.assertTrue(item.name) - - def test_read_dashboard(self): - data = self.dashboard.read_dashboard() - title_found = False - actions = 0 - for item in data['item_ids']: - if not item.get('kpi_id'): - title_found = True - if item.get('actions', False): - actions += len(item['actions']) - self.assertTrue(title_found) - self.assertEqual(0, actions) - act01 = self.env['ir.actions.act_window'].search( - [], limit=1) - self.env['kpi.kpi.action'].create({ - 'kpi_id': self.kpi_01.id, - 'action': '%s,%s' % (act01._name, act01.id) - }) - act02 = self.env['ir.actions.act_url'].search( - [], limit=1) - self.env['kpi.kpi.action'].create({ - 'kpi_id': self.kpi_01.id, - 'action': '%s,%s' % (act02._name, act02.id) - }) - data = self.dashboard.read_dashboard() - title_found = False - actions = 0 - for item in data['item_ids']: - if not item.get('kpi_id'): - title_found = True - if item.get('actions', False): - actions += len(item['actions']) - self.assertTrue(title_found) - self.assertEqual(2, actions) - - def test_compute(self): - self.assertFalse(self.kpi_01.value_last_update) - self.kpi_01.compute() - self.assertTrue(self.kpi_01.value_last_update)