Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
7960279
[FIX] add arg to workbook creation
bealdav Oct 7, 2015
4cdf22a
[ADD] Add Module report_qweb_element_page_visibility
Oct 27, 2015
9e5cbd0
Add module report_xml.
Jun 1, 2015
43e8ad2
Add template utf8_header.
Jun 12, 2015
357d37d
Easier XSD checking reports.
Jun 12, 2015
ae44772
Add sample module.
Jun 12, 2015
fe6f0cc
Sort links.
Jun 12, 2015
40adb5b
Fix XML tag mismatch.
Jun 12, 2015
93506ec
Allow docargs to be loaded from context.
Jun 15, 2015
2c2cf19
Only replace the docs key if it is missing.
Jun 15, 2015
3d5a0cb
Clearer code comments, add logging.
Jun 15, 2015
6e15df4
Oops, this header belongs to other module.
Jun 17, 2015
8c53e96
Add module report_xml_sample.
Jun 17, 2015
455d750
Clean AGPL garbage preserving copyright.
Jul 3, 2015
8aabfc2
Return supers.
Oct 15, 2015
40ed649
Add transifex settings
Nov 24, 2015
5d39238
Merge pull request #35 from numerigraphe/8.0-travis
pedrobaeza Nov 24, 2015
cd26894
Merge pull request #21 from grupoesoc/report-xml
gurneyalex Nov 25, 2015
0cf952e
Merge pull request #25 from akretion/prevent-style-making-error
gurneyalex Nov 25, 2015
df1ca48
Merge pull request #28 from hurrinico/extend_report
gurneyalex Nov 25, 2015
25f2a55
[UPD] addons table in README.md
OCA-git-bot Nov 26, 2015
fe8ffc0
[ADD] report_qweb_signer addon
antespi Nov 22, 2015
00c967b
Merge pull request #31 from Antiun/pr-report_qweb_signer
pedrobaeza Dec 14, 2015
595c938
[UPD] addons table in README.md
OCA-git-bot Dec 15, 2015
376b1e5
[FIX] Don't confuse API detection
StefanRijnhart Dec 16, 2015
16a1fd6
Merge pull request #36 from StefanRijnhart/8.0-report_custom_filename…
pedrobaeza Dec 16, 2015
b0ff585
Credit creators, using same name across modules to avoid split statis…
Jan 5, 2016
2cabbd4
Merge pull request #40 from grupoesoc/credits
pedrobaeza Jan 5, 2016
4d05881
[IMP] Define jPdfSign max heap size
antespi Jan 27, 2016
3dd6296
Merge pull request #41 from Antiun/pr-report_qweb_signer
pedrobaeza Jan 29, 2016
b154dde
[SEC] report_xls: fix unsafe eval
gurneyalex Feb 15, 2016
e0c4d18
Merge pull request #45 from gurneyalex/8.0-unsafe-eval
Feb 15, 2016
f900f30
[UPD] addons table in README.md
OCA-git-bot Feb 18, 2016
551c2b1
Revert "[SEC] report_xls: fix unsafe eval"
gurneyalex Feb 18, 2016
52a3d59
[ADD] Adding The BI Tool (8.0)
astirpe Mar 3, 2016
1f25992
Updated module description and list of contributors
astirpe Mar 3, 2016
e65c452
Update .travis.yml
Mar 9, 2016
ed76196
Added missing context on view
astirpe Mar 9, 2016
cdff77f
[ADD] Rebased BI Tool (8.0)
astirpe Mar 3, 2016
a5f92fa
Merge branch '80_add_bi_view_editor' of https://github.com/onesteinbv…
astirpe Mar 9, 2016
881ce6b
Attempting to fix registry reloading issue
astirpe Mar 10, 2016
3980102
Removed creation of new registry
astirpe Mar 10, 2016
690fcc7
Fixed broken handling of registry
astirpe Mar 10, 2016
f8c2aa3
Removed company name
astirpe Mar 11, 2016
cfa97f6
Removal of index.html
astirpe Mar 11, 2016
8f1cbf5
[FIX] .travis.yml
pedrobaeza Mar 11, 2016
9c6c9b9
Merge pull request #48 from pedrobaeza/8.0-travis
pedrobaeza Mar 11, 2016
cf72e8d
Code review: deleted index.html and registry fixes
astirpe Mar 10, 2016
c07827c
Merge branch '80_add_bi_view_editor' of https://github.com/onesteinbv…
astirpe Mar 11, 2016
ec8ccbc
Fix flake8 and pylint warnings
astirpe Mar 11, 2016
b03cc60
Updated contributors list
astirpe Mar 12, 2016
f1f7942
OCA Transbot updated translations from Transifex
oca-transbot Mar 13, 2016
1ccf7bb
Decorator api.one replaced with api.multi + added model description
astirpe Mar 21, 2016
0e9172c
Merge pull request #47 from onesteinbv/80_add_bi_view_editor
Mar 21, 2016
4d0a92c
[UPD] addons table in README.md
OCA-git-bot Mar 22, 2016
364e764
OCA Transbot updated translations from Transifex
oca-transbot Mar 27, 2016
076b9bb
[CHG] Rename base_report_xlsx to report_xlsx and add xlsx report type…
Apr 4, 2016
c368bad
[ADD] setup.py
OCA-git-bot Apr 14, 2016
3c2802f
[MIG] report_xlsx - Backport from the 9.0 branch
sebalix Apr 12, 2016
bf90b56
Merge pull request #50 from osiell/8.0-report_xlsx
sebastienbeau May 3, 2016
76b13ef
[UPD] addons table in README.md
OCA-git-bot May 4, 2016
8bc7148
[ADD] setup.py
OCA-git-bot May 4, 2016
77a627b
OCA Transbot updated translations from Transifex
oca-transbot May 8, 2016
b471978
FIX bug #56 crash in report_custom_filename
alexis-via Jun 1, 2016
22e80af
Use action['datas']['ids'] and fallback on context['active_ids']
alexis-via Jun 2, 2016
80fa1e5
OCA Transbot updated translations from Transifex
oca-transbot Jul 3, 2016
9462cc8
Merge pull request #57 from akretion/8.0-fix-bug-56
yvaucher Jul 12, 2016
0785891
Bump report_custom_filename version
yvaucher Jul 12, 2016
8cc6325
[UPD] addons table in README.md
OCA-git-bot Jul 13, 2016
2bf93a1
[FIX][report_xls] Protect xlwt import.
yajo Jul 25, 2016
b02cc1c
Fix linter warnings.
yajo Jul 25, 2016
2895aef
Merge pull request #62 from Tecnativa/8.0-report_xls-protected_import
pedrobaeza Jul 25, 2016
b7a757d
[FIX][8.0] revert class renamed report_xls
sergiocorato Jul 26, 2016
a5c2e77
Merge pull request #63 from sergiocorato/fix_report_xls
pedrobaeza Jul 26, 2016
fddca41
[FIX] report_xls: Add missing README.rst
pedrobaeza Aug 9, 2016
f180c3c
[IMP] README.md: Runbot flag
pedrobaeza Aug 13, 2016
65223f4
[FIX][report_xls] Protect import. (#64)
yajo Aug 13, 2016
b08b246
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
ac3a648
[FIX][report_xls] Add a variable when import fails.
yajo Aug 17, 2016
21d65b4
Merge pull request #67 from Tecnativa/8.0-report_xls-protected_import
pedrobaeza Aug 17, 2016
6ce9af8
[FIX] report_xlsx: Protect import + CamelCase class
pedrobaeza Aug 17, 2016
26bf6ef
Merge pull request #68 from OCA/8.0-report_xlsx-readme-fix
pedrobaeza Aug 19, 2016
64d940c
[FIX][report_xls] Fix regression introduced in 65223f4.
yajo Aug 22, 2016
63e99ca
[FIX] Override the field to add the value instead of breaking the val…
Feb 11, 2016
96ac860
Merge pull request #70 from Tecnativa/8.0-report_xls-fix_attributeerror
pedrobaeza Aug 23, 2016
a09b08e
[IMP] report_qweb_signer: Add feature request
pedrobaeza Sep 6, 2016
5cdde03
Merge pull request #42 from syleam/8.0-fix-report_type_field
lasley Sep 15, 2016
5f8d06e
OCA Transbot updated translations from Transifex
oca-transbot Sep 18, 2016
208cd4d
[UPD] prefix versions with 8.0
sbidoul Oct 8, 2016
c8cf13f
OCA Transbot updated translations from Transifex
oca-transbot Oct 9, 2016
e897f60
OCA Transbot updated translations from Transifex
oca-transbot Nov 29, 2016
b4495eb
OCA Transbot updated translations from Transifex
oca-transbot Dec 3, 2016
aa1878e
OCA Transbot updated translations from Transifex
oca-transbot Dec 10, 2016
44480c0
OCA Transbot updated translations from Transifex
oca-transbot Dec 17, 2016
1e2fbd9
OCA Transbot updated translations from Transifex
oca-transbot Dec 24, 2016
fe1560e
OCA Transbot updated translations from Transifex
oca-transbot Dec 31, 2016
c693f57
OCA Transbot updated translations from Transifex
oca-transbot Jan 7, 2017
6b8d459
OCA Transbot updated translations from Transifex
oca-transbot Jan 14, 2017
0a639e5
OCA Transbot updated translations from Transifex
oca-transbot Jan 21, 2017
5b1b4c2
OCA Transbot updated translations from Transifex
oca-transbot Feb 18, 2017
7e1dac8
OCA Transbot updated translations from Transifex
oca-transbot Feb 25, 2017
a3cbedc
OCA Transbot updated translations from Transifex
oca-transbot Mar 4, 2017
818d6df
OCA Transbot updated translations from Transifex
oca-transbot Mar 11, 2017
194cc2f
OCA Transbot updated translations from Transifex
oca-transbot Mar 18, 2017
8dfc689
[UPD] addons table in README.md
OCA-git-bot Mar 25, 2017
40669b7
[UPD] addons table in README.md
OCA-git-bot Mar 28, 2017
683d18f
[ADD] new module bi_sql_editor
legalsylvain Mar 27, 2017
1f445a3
[FIX] typo
legalsylvain Apr 24, 2017
41565a4
OCA Transbot updated translations from Transifex
oca-transbot May 1, 2017
0552fef
Merge pull request #102 from grap/8.0_ADD_bi_sql_editor
legalsylvain Jun 2, 2017
209422c
[UPD] addons table in README.md
OCA-git-bot Jun 3, 2017
ca5e4d4
[ADD] setup.py
OCA-git-bot Jun 3, 2017
ebb0589
OCA Transbot updated translations from Transifex
oca-transbot Jun 3, 2017
e01394b
OCA Transbot updated translations from Transifex
oca-transbot Jun 10, 2017
baf7e56
OCA Transbot updated translations from Transifex
oca-transbot Jul 1, 2017
07bc923
[IMP] replace deprecated pooler by RegistryManager
hbrunn Jul 8, 2017
648a730
Merge pull request #147 from hbrunn/8.0-report_xls-deprecated_pooler
pedrobaeza Jul 9, 2017
0eb3088
OCA Transbot updated translations from Transifex
oca-transbot Aug 19, 2017
da89870
OCA Transbot updated translations from Transifex
oca-transbot Sep 2, 2017
3d5d214
OCA Transbot updated translations from Transifex
oca-transbot Oct 28, 2017
14ae3e5
OCA Transbot updated translations from Transifex
oca-transbot Nov 11, 2017
dc29e55
OCA Transbot updated translations from Transifex
oca-transbot Nov 25, 2017
d7909e8
fix(report.xls): Add the self.localcontex to know the active language
Jan 19, 2018
be8d8f7
chore(modules): disable not installable modules
agb80 Jan 23, 2018
9b05758
[FIX] unlink rule before model
legalsylvain Jan 17, 2018
f929bc7
[FIX] call super for unlink
legalsylvain Feb 12, 2018
1e300e8
OCA Transbot updated translations from Transifex
oca-transbot Mar 3, 2018
67bbc3c
[ADD] setup.py [ci skip]
OCA-git-bot Apr 19, 2018
998a670
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
c3c6fc3
trigger Travis build to generate .pot
sbidoul Jun 23, 2018
3a0e051
[UPD] Update bi_sql_editor.pot
oca-travis Jun 23, 2018
a00361b
[UPD] Update bi_view_editor.pot
oca-travis Jun 23, 2018
9578f03
[UPD] Update report_custom_filename.pot
oca-travis Jun 23, 2018
a41a6d6
[UPD] Update report_qweb_element_page_visibility.pot
oca-travis Jun 23, 2018
e91c4cb
[UPD] Update report_qweb_signer.pot
oca-travis Jun 23, 2018
3e8443a
[UPD] Update report_xls.pot
oca-travis Jun 23, 2018
f6f3260
[UPD] Update report_xlsx.pot
oca-travis Jun 23, 2018
8a0eba1
[UPD] Update report_xml.pot
oca-travis Jun 23, 2018
82e2467
[UPD] Update report_xml_sample.pot
oca-travis Jun 23, 2018
a13762f
[ADD] create ui now create tree view
legalsylvain Jul 14, 2017
4d43251
[UPD] Update bi_sql_editor.pot
oca-travis Aug 1, 2018
59bb6d6
[FIX] prepare of cron
legalsylvain Jul 4, 2018
af546c5
[FIX] numbercall value set to -1
legalsylvain Aug 1, 2018
e1c473e
[UPD] Update bi_sql_editor.pot
oca-travis Aug 3, 2018
ea9a510
Update translation files
oca-transbot Dec 9, 2018
1592b0b
Merge remote-tracking branch 'oca/8.0' into 8.0
agb80 Apr 24, 2019
48861f6
fix(bi.sql.view.field): Se corrige el llenado de data
ricardovalencia97 Aug 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 21 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
language: python
sudo: false
cache: pip
cache:
apt: true
directories:
- $HOME/.cache/pip

python:
- "2.7"

addons:
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow

language: python

python:
- "2.7"

env:
- VERSION="8.0" LINT_CHECK="1"
- VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0"
- VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0"
global:
- VERSION="8.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
- TRANSIFEX_USER='transbot@odoo-community.org'
- secure: NUsXwVrMntcqge1ozKW+DSkP7dq+Rla6JVvFF2c89/g+zJaIqQRi8EQBLoqNwCdMk+rjpQeZt/JPELjH+EzPcmGddhDxOgVB3nUT9LvFXGCHF+NjmHXqyba4tuc7BnpG1WDD+rSlxVCt1aIjNIhhaZ4ic0rCWpKNYu/yFTsmChc=
matrix:
- LINT_CHECK="1"
- TRANSIFEX="1"
- TESTS="1" ODOO_REPO="odoo/odoo"
- TESTS="1" ODOO_REPO="OCA/OCB"

virtualenv:
system_site_packages: true

install:
- pip install xlwt
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly ${VERSION}
- travis_install_nightly

script:
- travis_run_tests ${VERSION}
- travis_run_tests

after_success:
coveralls
- travis_after_tests_success
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/143/8.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-reporting-engine-143)
[![Build Status](https://travis-ci.org/OCA/reporting-engine.svg?branch=8.0)](https://travis-ci.org/OCA/reporting-engine)
[![Coverage Status](https://img.shields.io/coveralls/OCA/reporting-engine.svg)](https://coveralls.io/r/OCA/reporting-engine?branch=8.0)

Expand All @@ -16,12 +17,21 @@ The convention is to use a suffix to each module to indicate that it's for using
It can contain also another utilities directly involved with reports (like merge/split utils, checkers, signing tools and so on).

[//]: # (addons)

Available addons
----------------
addon | version | summary
--- | --- | ---
[report_custom_filename](report_custom_filename/) | 8.0.1.0.0 | Configure the filename to use when downloading a report
[report_xls](report_xls/) | 8.0.0.6.0 | Excel report engine
[bi_sql_editor](bi_sql_editor/) | 8.0.1.0.0 | BI Views builder, based on Materialized or Normal SQL Views
[bi_view_editor](bi_view_editor/) | 8.0.1.0.0 | Graphical BI views builder for Odoo 8
[report_custom_filename](report_custom_filename/) | 8.0.1.0.1 | Configure the filename to use when downloading a report
[report_qweb_element_page_visibility](report_qweb_element_page_visibility/) | 8.0.1.0.0 | Report Qweb Element Page Visibility
[report_qweb_signer](report_qweb_signer/) | 8.0.1.0.0 | Sign Qweb PDFs usign a PKCS#12 certificate
[report_xls](report_xls/) | 8.0.0.6.1 | Excel report engine
[report_xlsx](report_xlsx/) | 8.0.1.0.0 | Base module to create xlsx report
[report_xml](report_xml/) | 8.0.1.0.0 | Allow to generate XML reports
[report_xml_sample](report_xml_sample/) | 8.0.1.0.0 | For developers who want an example


Unported addons
---------------
Expand Down
36 changes: 0 additions & 36 deletions base_report_assembler/i18n/base_report_assembler.pot

This file was deleted.

184 changes: 184 additions & 0 deletions bi_sql_editor/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===========================================================
BI Views builder, based on Materialized or Normal SQL Views
===========================================================

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

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

To configure this module, you need to:

* Go to Settings / Technical / Database Structure / SQL Views

* tip your SQL request

.. figure:: /bi_sql_editor/static/description/01_sql_request.png
:width: 800 px

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

.. figure:: /bi_sql_editor/static/description/02_security_access.png
:width: 800 px

* Click on the button 'Clean and Check Request'

* 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.

.. figure:: /bi_sql_editor/static/description/03_field_mapping.png
:width: 800 px

* Click on the button 'Create SQL View, Indexes and Models'. (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)

.. figure:: /bi_sql_editor/static/description/04_materialized_view_setting.png
:width: 800 px

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

Usage
=====

To use this module, you need to:

* Go to 'Reporting' / 'Custom Reports'

* select the desired report

.. figure:: /bi_sql_editor/static/description/05_reporting_pivot.png
:width: 800 px

* You can switch to 'Pie' chart or 'Line Chart' as any report,

.. figure:: /bi_sql_editor/static/description/05_reporting_pie.png
:width: 800 px

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/143/8.0

Known issues / Roadmap
======================

* Add 'interval', after type (row/col/measure) field for date(time) fields.

Note
====

* If the view is materialized, the name of the action will contain the date
and the time of it last refresh:

.. figure:: /bi_sql_editor/static/description/06_action_datetime_name.png
:width: 800 px

* The syntax of the sql request has the following constrains: the name of the
selectable columns should be prefixed by `x_`

Sample:

.. code-block:: sql

SELECT name as x_name
FROM res_partner

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 smash it by providing detailed and welcomed feedback.

Credits
=======

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

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

* 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/8.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


Funders
-------

The development of this module has been financially supported by:

* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
3 changes: 3 additions & 0 deletions bi_sql_editor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import models
28 changes: 28 additions & 0 deletions bi_sql_editor/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# 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': '8.0.1.0.0',
'license': 'AGPL-3',
'category': 'Reporting',
'author': 'GRAP,Odoo Community Association (OCA)',
'website': 'https://www.odoo-community.org',
'depends': [
'sql_request_abstract',
],
'data': [
'security/ir.model.access.csv',
'views/view_bi_sql_view.xml',
'views/action.xml',
'views/menu.xml',
],
'demo': [
'demo/res_groups.xml',
'demo/bi_sql_view.xml',
],
'installable': True,
}
59 changes: 59 additions & 0 deletions bi_sql_editor/demo/bi_sql_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?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).
-->

<openerp><data>

<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="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>

<function model="bi.sql.view" name="button_validate_sql_expression" eval="([ref('partner_sql_view')])"/>

<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>

<function model="bi.sql.view" name="button_validate_sql_expression" eval="([ref('module_sql_view')])"/>

<function model="bi.sql.view" name="button_create_sql_view_and_model" eval="([ref('module_sql_view')])"/>

<function model="bi.sql.view" name="button_create_ui" eval="([ref('module_sql_view')])"/>

</data></openerp>
Loading