Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream OCA/reporting-engine (17.0) #623

Merged
merged 164 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
3e5085f
new module bi_sql_editor [IMP] function to guess model for many2one f…
legalsylvain Mar 27, 2017
a81d5b3
OCA Transbot updated translations from Transifex
oca-transbot Jun 3, 2017
09d8358
bi_sql_editor
nicomacr Jul 11, 2017
6083d5b
create ui now create tree view [IMP] fr translation [IMP] add last re…
legalsylvain Jul 14, 2017
5190269
[IMP] Add test + several fixes
AaronHForgeFlow Jul 17, 2017
c54b2eb
OCA Transbot updated translations from Transifex
oca-transbot Aug 19, 2017
426066c
FIX bi_sql_editor
nicomacr Aug 14, 2017
afb9e31
[MIG] bi_sql_editor v10
serpentcs-dev1 Sep 4, 2017
872e93a
[IMP] preview button
serpentcs-dev1 Oct 3, 2017
d8d5f41
Fix several issues
p-tombez Apr 13, 2018
d7c2854
10.0 imp bi sql editor (#1)
legalsylvain Jul 23, 2018
f78ebfb
[UPD] Update bi_sql_editor.pot
oca-travis Jul 24, 2018
ab9c97f
[MIG] bi_sql_editor: Migration to 11.0
HviorForgeFlow Jul 25, 2018
e05d1ac
[FIX] Can be upgraded with materialized views generated
HviorForgeFlow Aug 28, 2018
1144f86
[FIX] ir.cron relation
MiquelRForgeFlow Aug 31, 2018
d0bc467
[IMP] remove unneeded parenthesis
MiquelRForgeFlow Sep 3, 2018
ae2186c
[FIX] Solves the upgrading problem
MiquelRForgeFlow Sep 4, 2018
54fc897
[FIX] Query and technical name should only be modifiable in draft mode
MiquelRForgeFlow Sep 6, 2018
d338a71
[UPD] Update bi_sql_editor.pot
oca-travis Sep 19, 2018
a9bcacb
Update translation files
oca-transbot Dec 9, 2018
c5a1509
[12.0][MIG] Migrate module bi_sql_editor to v12
AdriaGForgeFlow Dec 14, 2018
1101f9a
[FIX] bi_sql_editor: add in readme how to solve the update all break
MiquelRForgeFlow Jan 15, 2019
80bc801
Update readme
AdriaGForgeFlow Jan 16, 2019
df93854
bi_sql_editor 12.0.1.2.0
OCA-git-bot Mar 8, 2019
c271927
Update translation files
oca-transbot Mar 17, 2019
72fa6cc
Translated using Weblate (German)
rschnapka Apr 24, 2019
1bb7abb
[FIX] bi_sql_editor: Fixes images path
pedrobaeza Jul 26, 2019
3299712
[FIX] bi_sql_editor: Add required attribute name on filters
HviorForgeFlow Sep 13, 2019
b1723a8
change SQL mapping for date
HviorForgeFlow Sep 23, 2019
14d8c88
[ADD] action context
legalsylvain Mar 18, 2020
ab35aab
Update translation files
oca-transbot Mar 28, 2020
8adb402
[WIP] imp bi_sql_editor
legalsylvain Jun 18, 2020
c077720
[FIX] bi_sql_editor : handle correctly translation for action name
legalsylvain Nov 12, 2020
741f260
[IMP] bi_sql_editor : conserve cron settings, when setting materializ…
legalsylvain Jun 7, 2021
535a2c1
[IMP] bi_sql_editor: black, isort, prettier
HviorForgeFlow Apr 15, 2020
9d1c79f
[MIG] bi_sql_editor: Migration to 13.0
HviorForgeFlow Apr 15, 2020
6df1965
bi_sql_editor 13.0.1.0.1
OCA-git-bot May 26, 2020
d8e2d6c
Translated using Weblate (Spanish)
anasuarez1 Mar 9, 2021
3deb954
[IMP] bi_sql_editor: black, isort, prettier
davejames Jun 7, 2021
52d3e86
bi_sql_editor: Migration to 14.0
davejames Jun 8, 2021
44eaffa
bi_sql_editor: add support for group operators
davejames Jun 7, 2021
e1c3368
[UPD] Update bi_sql_editor.pot
oca-travis Jun 11, 2021
a24c3d6
[UPD] README.rst
OCA-git-bot Jun 11, 2021
6e9d611
[IMP] bi_sql_editor: black, isort, prettier
mariadforgeflow Dec 13, 2021
26bc8bc
[MIG] bi_sql_editor: Migration to 15.0
mariadforgeflow Dec 13, 2021
0e691ba
[UPD] Update bi_sql_editor.pot
Jan 24, 2022
4a36cd2
[UPD] README.rst
OCA-git-bot Jan 24, 2022
19bc6bc
[FIX] bi_sql_editor: fix typo
mariadforgeflow Feb 1, 2022
c9e9f61
bi_sql_editor 15.0.1.0.1
OCA-git-bot Feb 1, 2022
bcb58e9
[IMP] bi_sql_editor: Remove useless monkeypatch
lmignon Mar 16, 2022
8963def
bi_sql_editor 15.0.1.0.2
OCA-git-bot Mar 16, 2022
af8aadb
Translated using Weblate (Catalan)
pablontura Apr 22, 2022
55e09d3
Translated using Weblate (Catalan)
jabelchi Jun 15, 2022
2766be4
[MIG] bi_sql_editor : from 15.0 to 16.0
legalsylvain Oct 25, 2022
160c7c8
[IMP] bi_sql_editor manual field check performance
paulius-sladkevicius Nov 16, 2022
96f4d06
[IMP] bi_sql_editor : add field context
legalsylvain Dec 16, 2021
088d581
[UPD] Update bi_sql_editor.pot
Feb 17, 2023
87f555b
[UPD] README.rst
OCA-git-bot Feb 17, 2023
4954bc7
Translated using Weblate (Italian)
mymage Mar 23, 2023
46c034b
Translated using Weblate (Spanish (Argentina))
ibuioli Apr 7, 2023
749501f
Translated using Weblate (Slovenian)
sysadminmatmoz Apr 11, 2023
ea4a6e4
Update bi_sql_view.py
May 31, 2023
60de210
[FIX] unlink bi_sql_view without cron
Jun 15, 2023
6487b9a
bi_sql_editor 16.0.1.0.3
OCA-git-bot Jun 15, 2023
d181def
Translated using Weblate (Italian)
mymage Jun 20, 2023
750dbfe
bi_sql_editor 16.0.1.0.4
OCA-git-bot Jul 2, 2023
4096b8a
[UPD] Update bi_sql_editor.pot
Aug 28, 2023
3f2469a
Translated using Weblate (Spanish)
Ivorra78 Aug 23, 2023
d0c1bc3
Update translation files
weblate Sep 2, 2023
f067c39
[UPD] README.rst
OCA-git-bot Sep 3, 2023
6b8839d
Translated using Weblate (Spanish)
Ivorra78 Sep 7, 2023
bef02f6
[UPD] Update bi_sql_editor.pot
Oct 27, 2023
9a6e19b
Update translation files
weblate Oct 29, 2023
e9a1446
[16.0][FIX][bi_sql_editor] unlink bi_sql_view without cron
leemannd Nov 14, 2023
d6c7160
[BOT] post-merge updates
OCA-git-bot Nov 14, 2023
d3fe703
create a new module sql_request_abstract
legalsylvain Feb 22, 2017
8805ea9
Fix version
florian-dacosta Mar 6, 2017
b6bb6ff
various improvement. Courtesy @dreispt review
legalsylvain Apr 18, 2017
93af5b0
OCA Transbot updated translations from Transifex
oca-transbot Jun 10, 2017
a9c7172
OCA Transbot updated translations from Transifex
oca-transbot Jul 1, 2017
bad0540
[MIG] sql_request_abstract v10
serpentcs-dev1 Sep 4, 2017
7650b04
OCA Transbot updated translations from Transifex
oca-transbot Dec 2, 2017
9374c90
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
b61e30a
[UPD] Update sql_request_abstract.pot
oca-travis Jun 24, 2018
a88170c
[FIX] mogrify doesn't allow dicts
MiquelRForgeFlow Jun 25, 2018
057e587
[UPD] Update sql_request_abstract.pot
oca-travis Jun 27, 2018
8e91b99
[MIG] sql_request_abstract: Migration to 11.0
HviorForgeFlow Jul 25, 2018
c2a78ba
[UPD] Update sql_request_abstract.pot
oca-travis Sep 19, 2018
ddd06ff
Update translation files
oca-transbot Nov 26, 2018
f90fb23
[12.0][MIG] Migrate module sql_request_abstract to v12
AdriaGForgeFlow Dec 14, 2018
2d8c2ce
[UPD] README.rst
OCA-git-bot Mar 8, 2019
817f454
[UPD] Update sql_request_abstract.pot
oca-travis Mar 8, 2019
f6c5ba9
Update translation files
oca-transbot Mar 17, 2019
2604824
FIX sql_request_abstract: b64encode use a Bytes like object
bealdav Apr 8, 2019
cb76ce1
[UPD] Update sql_request_abstract.pot
oca-travis Apr 8, 2019
2bc7a40
Update translation files
oca-transbot May 20, 2019
696118c
[UPD] README.rst
OCA-git-bot Jul 29, 2019
9badb00
Translated using Weblate (Chinese (Simplified))
liweijie0812 Aug 31, 2019
32a7578
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
bb2a908
ADD module mrp_component_consumption_gap
bealdav Oct 24, 2019
f609f9b
[UPD] Update sql_request_abstract.pot
oca-travis Oct 24, 2019
294bd76
Update translation files
oca-transbot Oct 24, 2019
8bbbabb
[IMP] sql_request_abstract black, isort
Mar 5, 2020
5cdc42f
[MIG] sql_request_abstract: Migration to 13.0
Mar 5, 2020
fcf3c80
[UPD] Update sql_request_abstract.pot
oca-travis May 26, 2020
a332086
[UPD] README.rst
OCA-git-bot May 26, 2020
ea74c3c
sql_request_abstract 13.0.1.0.1
OCA-git-bot May 26, 2020
56e93a2
Update translation files
oca-transbot Jun 4, 2020
27b8816
[IMP] sql_request_abstract: black, isort, prettier
mourad-ehm Nov 3, 2020
9d6d677
[MIG] sql_request_abstract: Migration to 14.0
mourad-ehm Nov 3, 2020
2d7d7a2
[UPD] Update sql_request_abstract.pot
oca-travis Dec 22, 2020
e47bcb3
[UPD] README.rst
OCA-git-bot Dec 22, 2020
dce304f
Migrate to 14.0
florian-dacosta Mar 22, 2021
1f5f1a3
[UPD] Update sql_request_abstract.pot
oca-travis Apr 30, 2021
ea9a878
Update translation files
oca-transbot Apr 30, 2021
dde2b5c
Translated using Weblate (French)
Yvesldff May 14, 2021
3c538fe
Update roadmap for v15 and make some usability improvements
florian-dacosta May 20, 2021
31d40d1
[UPD] README.rst
OCA-git-bot May 22, 2021
7070cb0
[PORT] 14.0 port #2061 : sql_export : add preview button
legalsylvain Apr 2, 2021
943f09c
[ADD] maintainers to module sql_request_abstract
legalsylvain Jun 8, 2021
be59ac5
[Fix]: Add header feature in latest v14
hkapatel-initos Jul 16, 2021
7102486
[UPD] README.rst
OCA-git-bot Jul 20, 2021
b0db939
[UPD] README.rst
OCA-git-bot Jul 20, 2021
9832624
sql_request_abstract 14.0.1.0.2
OCA-git-bot Jul 20, 2021
83edbf3
sql_request_abstract 14.0.1.1.0
OCA-git-bot Jul 28, 2021
463eb8a
[IMP] sql_request_abstract: black, isort, prettier
mariadforgeflow Dec 2, 2021
acfc678
[MIG] sql_request_abstract: Migration to 15.0
mariadforgeflow Dec 2, 2021
8e1edef
[UPD] Update sql_request_abstract.pot
Dec 9, 2021
2af2e6d
[UPD] README.rst
OCA-git-bot Dec 9, 2021
a7a94b9
Translated using Weblate (Catalan)
jabelchi Jun 15, 2022
965df8f
[MIG] sql_request_abstract from 15.0 to 16.0
legalsylvain Oct 25, 2022
fd24573
[UPD] Update sql_request_abstract.pot
Nov 23, 2022
abe67bc
[UPD] README.rst
OCA-git-bot Nov 23, 2022
f7390f7
Update translation files
weblate Nov 23, 2022
3b33350
Translated using Weblate (Spanish (Argentina))
ibuioli Dec 4, 2022
0ee82eb
Translated using Weblate (Italian)
mymage Dec 28, 2022
b5db311
Translated using Weblate (Spanish)
Ivorra78 Jul 13, 2023
bcfd06d
[UPD] Update sql_request_abstract.pot
Aug 28, 2023
51bfd7f
Update translation files
weblate Sep 2, 2023
4b1f4a6
[UPD] README.rst
OCA-git-bot Sep 3, 2023
f0c0d9f
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 4, 2023
1826e54
Translated using Weblate (Spanish)
Ivorra78 Sep 7, 2023
150035e
Update translation files
weblate Oct 9, 2023
8767a83
[UPD] Update sql_request_abstract.pot
Oct 27, 2023
4e9ea99
Update translation files
weblate Oct 29, 2023
8a66871
Translated using Weblate (Italian)
mymage Nov 3, 2023
c8ac6d7
[IMP] sql_request_abstract: pre-commit auto fixes
nguyenminhchien Dec 19, 2023
6642849
[IMP] bi_sql_editor: pre-commit auto fixes
nguyenminhchien Dec 19, 2023
ebf330c
[IMP] bi_sql_editor : make installation idempotens
legalsylvain Dec 5, 2023
2e85b11
[REF] bi_sql_editor : simplify module tests
legalsylvain Dec 5, 2023
b6f4b88
[REF] bi_sql_editor : Make test independant
legalsylvain Dec 5, 2023
36e8506
[FIX] bi_sql_editor : do not allow to create model (and sql views) if…
legalsylvain Dec 5, 2023
6c7f3e8
[FIX] bi_sql_editor : use correct key word 'optional'. (and not 'opti…
legalsylvain Dec 5, 2023
a8fb06f
[IMP] bi_sql_editor : allow to reset to the previous state, and not o…
legalsylvain Dec 5, 2023
c537e07
[REF] bi_sql_editor : simplification : Remove conditional display rel…
legalsylvain Dec 5, 2023
7ec031d
[REM] bi_sql_editor : option_context_field field, as it is now possib…
legalsylvain Dec 5, 2023
107213c
[IMP] bi_sql_editor : Allow to change fields settings if state is 'Mo…
legalsylvain Dec 5, 2023
9960059
[IMP] bi_sql_editor : Improve code coverage, adding various settings …
legalsylvain Dec 5, 2023
c127fa0
[MIG] sql_request_abstract: Migration to 17.0
nguyenminhchien Dec 21, 2023
c8471a0
[MIG] bi_sql_editor: Migration to 17.0
nguyenminhchien Dec 21, 2023
af92c41
Merge PR #832 into 17.0
OCA-git-bot Jan 8, 2024
318ffd4
[UPD] Update bi_sql_editor.pot
Jan 8, 2024
a4f9832
[UPD] Update sql_request_abstract.pot
Jan 8, 2024
304c394
[BOT] post-merge updates
OCA-git-bot Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[bi_sql_editor](bi_sql_editor/) | 17.0.1.0.1 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | BI Views builder, based on Materialized or Normal SQL Views
[report_qweb_parameter](report_qweb_parameter/) | 17.0.1.0.0 | | Add new parameters for qweb templates in order to reduce field length and check minimal length
[report_xlsx](report_xlsx/) | 17.0.1.0.0 | | Base module to create xlsx report
[sql_request_abstract](sql_request_abstract/) | 17.0.1.0.1 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Abstract Model to manage SQL Requests

[//]: # (end addons)

Expand Down
207 changes: 207 additions & 0 deletions bi_sql_editor/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
=============
BI SQL Editor
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:424f915993d81045a5243c2754398a7e6603844fc6a656a5ddad6479502ff981
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/17.0/bi_sql_editor
: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-17-0/reporting-engine-17-0-bi_sql_editor
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the functionality of reporting, to support creation
of extra custom reports. It allows user to write a custom SQL request.
(Generally, admin users)

Once written, a new model is generated, and user can map the selected
field with odoo fields. Then user ends the process, creating new menu,
action and graph view.

Technically, the module create SQL View (or materialized view, if option
is checked). Materialized view duplicates datas, but request are
fastest. If materialized view is enabled, this module will create a cron
task to refresh the data).

By default, users member of 'SQL Request / User' can see all the views.
You can specify extra groups that have the right to access to a specific
view.

Warning
-------

This module is intended for technician people in a company and for Odoo
integrators.

It requires the user to know SQL syntax and Odoo models.

If you don't have such skills, do not try to use this module specially
on a production environment.

Use Cases
---------

this module is interesting for the following use cases

- You want to realize technical SQL requests, that Odoo framework
doesn't allow (For exemple, UNION with many SELECT) A typical use
case is if you want to have Sale Orders and PoS Orders datas in a
same table
- You want to customize an Odoo report, removing some useless fields
and adding some custom ones. In that case, you can simply select the
fields of the original report (sale.report model for exemple), and
add your custom fields
- You have a lot of data, and classical SQL Views have very bad
performance. In that case, MATERIALIZED VIEW will be a good solution
to reduce display duration

**Table of contents**

.. contents::
:local:

Configuration
=============

- Go to Dashboard / Configuration / SQL Views

- tip your SQL request

|image1|

- Select the group(s) that could have access to the view

|image2|

Optionnaly, you can add a domain.

A tipical domain in a multi company context is to write
``['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]``
to make reporting depending on the current companies of the user.

- Click on the button 'Validate SQL Expression'

- Once the sql request checked, the module analyses the column of the
view, and propose field mapping. For each field, you can decide to
create an index and set if it will be displayed on the pivot graph as
a column, a row or a measure.

|image3|

- Click on the button 'Create SQL elements'. (this step could take a
while, if view is materialized)

- If it's a MATERIALIZED view:

- a cron task is created to refresh the view. You can so define
the frequency of the refresh.
- the size of view (and the indexes is displayed)

|image4|

- Finally, click on 'Create UI', to create new menu, action, graph view
and search view.

.. |image1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/17.0/bi_sql_editor/static/description/01_sql_request.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/reporting-engine/17.0/bi_sql_editor/static/description/02_security_access.png
.. |image3| image:: https://raw.githubusercontent.com/OCA/reporting-engine/17.0/bi_sql_editor/static/description/03_field_mapping.png
.. |image4| image:: https://raw.githubusercontent.com/OCA/reporting-engine/17.0/bi_sql_editor/static/description/04_materialized_view_setting.png

Usage
=====

To use this module, you need to:

1. Go to 'Dashboards > SQL Reports'
2. Select the desired report

..

|usage-image1|

- You can switch to 'Graph' or 'tree' views as any report.

.. |usage-image1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/17.0/bi_sql_editor/static/description/05_reporting_pivot.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20bi_sql_editor%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* GRAP

Contributors
------------

- Sylvain LE GAL (https://twitter.com/legalsylvain)

- Richard deMeester, WilldooIT (http://www.willdooit.com/)

- David James, WilldooIT (http://www.willdooit.com/)

- This module is highly inspired by the work of

- Onestein: (http://www.onestein.nl/) Module:
OCA/server-tools/bi_view_editor. Link:
https://github.com/OCA/reporting-engine/tree/9.0/bi_view_editor
- Anybox: (https://anybox.fr/) Module :
OCA/server-tools/materialized_sql_view link:
https://github.com/OCA/server-tools/pull/110
- GRAP, Groupement Régional Alimentaire de Proximité:
(http://www.grap.coop/) Module:
grap/odoo-addons-misc/pos_sale_reporting link:
https://github.com/grap/odoo-addons-misc/tree/7.0/pos_sale_reporting

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.

.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/17.0/bi_sql_editor>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions bi_sql_editor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import uninstall_hook
25 changes: 25 additions & 0 deletions bi_sql_editor/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "BI SQL Editor",
"summary": "BI Views builder, based on Materialized or Normal SQL Views",
"version": "17.0.1.0.1",
"license": "AGPL-3",
"category": "Reporting",
"author": "GRAP,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"depends": [
"spreadsheet_dashboard",
"sql_request_abstract",
],
"data": [
"security/ir.model.access.csv",
"views/view_bi_sql_view.xml",
],
"demo": ["demo/res_groups_demo.xml", "demo/bi_sql_view_demo.xml"],
"installable": True,
"uninstall_hook": "uninstall_hook",
"maintainers": ["legalsylvain"],
}
53 changes: 53 additions & 0 deletions bi_sql_editor/demo/bi_sql_view_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2014 - Today GRAP (http://www.grap.coop)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="incorrect_sql_view" model="bi.sql.view">
<field name="name">Draft Incorrect SQL View</field>
<field name="technical_name">incorrect_view</field>
<field
name="query"
><![CDATA[
SELECT *
FROM unexisting_table
ORDER BY unexisting_field
]]>
</field>
</record>
<record id="partner_sql_view" model="bi.sql.view">
<field name="name">Partners View</field>
<field name="technical_name">partners_view</field>
<field name="is_materialized" eval="True" />
<field
name="query"
><![CDATA[
SELECT
name as x_name,
street as x_street,
company_id as x_company_id
FROM res_partner
ORDER BY name
]]>
</field>
</record>
<record id="module_sql_view" model="bi.sql.view">
<field name="name">Modules by Authors</field>
<field name="technical_name">modules_view</field>
<field name="is_materialized" eval="0" />
<field
name="query"
><![CDATA[
SELECT
name as x_name,
case
when author ilike '%OpenERP SA%' THEN 'Odoo SA'
when author ilike '%Odoo Community Association (OCA)%' THEN 'OCA'
else 'Undefined Author' END as x_author_type
FROM ir_module_module
]]>
</field>
</record>
</odoo>
14 changes: 14 additions & 0 deletions bi_sql_editor/demo/res_groups_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2014 - Today GRAP (http://www.grap.coop)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="base.group_no_one" model="res.groups">
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>
<record id="sql_request_abstract.group_sql_request_user" model="res.groups">
<field name="users" eval="[(4, ref('base.user_demo'))]" />
</record>
</odoo>
8 changes: 8 additions & 0 deletions bi_sql_editor/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2015-2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


def uninstall_hook(env):
recs = env["bi.sql.view"].search([])
for rec in recs:
rec.button_set_draft()
Loading
Loading