|
| 1 | +============= |
| 2 | +BI SQL Editor |
| 3 | +============= |
| 4 | + |
| 5 | +.. |
| 6 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 7 | + !! This file is generated by oca-gen-addon-readme !! |
| 8 | + !! changes will be overwritten. !! |
| 9 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 10 | + !! source digest: sha256:1acb226c184032febd7db6e48ee618c7e5a6899c4685aa78b5b2e7578ebd9ce9 |
| 11 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 12 | +
|
| 13 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 14 | + :target: https://odoo-community.org/page/development-status |
| 15 | + :alt: Beta |
| 16 | +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
| 17 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 18 | + :alt: License: AGPL-3 |
| 19 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github |
| 20 | + :target: https://github.com/OCA/reporting-engine/tree/18.0/bi_sql_editor |
| 21 | + :alt: OCA/reporting-engine |
| 22 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 23 | + :target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-bi_sql_editor |
| 24 | + :alt: Translate me on Weblate |
| 25 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 26 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=18.0 |
| 27 | + :alt: Try me on Runboat |
| 28 | + |
| 29 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 30 | + |
| 31 | +This module extends the functionality of reporting, to support creation |
| 32 | +of extra custom reports. It allows user to write a custom SQL request. |
| 33 | +(Generally, admin users) |
| 34 | + |
| 35 | +Once written, a new model is generated, and user can map the selected |
| 36 | +field with odoo fields. Then user ends the process, creating new menu, |
| 37 | +action and graph view. |
| 38 | + |
| 39 | +Technically, the module create SQL View (or materialized view, if option |
| 40 | +is checked). Materialized view duplicates datas, but request are |
| 41 | +fastest. If materialized view is enabled, this module will create a cron |
| 42 | +task to refresh the data). |
| 43 | + |
| 44 | +By default, users member of 'SQL Request / User' can see all the views. |
| 45 | +You can specify extra groups that have the right to access to a specific |
| 46 | +view. |
| 47 | + |
| 48 | +Warning |
| 49 | +------- |
| 50 | + |
| 51 | +This module is intended for technician people in a company and for Odoo |
| 52 | +integrators. |
| 53 | + |
| 54 | +It requires the user to know SQL syntax and Odoo models. |
| 55 | + |
| 56 | +If you don't have such skills, do not try to use this module specially |
| 57 | +on a production environment. |
| 58 | + |
| 59 | +Use Cases |
| 60 | +--------- |
| 61 | + |
| 62 | +this module is interesting for the following use cases |
| 63 | + |
| 64 | +- You want to realize technical SQL requests, that Odoo framework |
| 65 | + doesn't allow (For exemple, UNION with many SELECT) A typical use |
| 66 | + case is if you want to have Sale Orders and PoS Orders datas in a |
| 67 | + same table |
| 68 | +- You want to customize an Odoo report, removing some useless fields |
| 69 | + and adding some custom ones. In that case, you can simply select the |
| 70 | + fields of the original report (sale.report model for exemple), and |
| 71 | + add your custom fields |
| 72 | +- You have a lot of data, and classical SQL Views have very bad |
| 73 | + performance. In that case, MATERIALIZED VIEW will be a good solution |
| 74 | + to reduce display duration |
| 75 | + |
| 76 | +**Table of contents** |
| 77 | + |
| 78 | +.. contents:: |
| 79 | + :local: |
| 80 | + |
| 81 | +Configuration |
| 82 | +============= |
| 83 | + |
| 84 | +- Go to Dashboard / Configuration / SQL Views |
| 85 | + |
| 86 | +- tip your SQL request |
| 87 | + |
| 88 | + |image1| |
| 89 | + |
| 90 | +- Select the group(s) that could have access to the view |
| 91 | + |
| 92 | + |image2| |
| 93 | + |
| 94 | +Optionnaly, you can add a domain. |
| 95 | + |
| 96 | +A tipical domain in a multi company context is to write |
| 97 | +``['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]`` |
| 98 | +to make reporting depending on the current companies of the user. |
| 99 | + |
| 100 | +- Click on the button 'Validate SQL Expression' |
| 101 | + |
| 102 | +- Once the sql request checked, the module analyses the column of the |
| 103 | + view, and propose field mapping. For each field, you can decide to |
| 104 | + create an index and set if it will be displayed on the pivot graph as |
| 105 | + a column, a row or a measure. |
| 106 | + |
| 107 | + |image3| |
| 108 | + |
| 109 | +- Click on the button 'Create SQL elements'. (this step could take a |
| 110 | + while, if view is materialized) |
| 111 | + |
| 112 | +- If it's a MATERIALIZED view: |
| 113 | + |
| 114 | + - a cron task is created to refresh the view. You can so define |
| 115 | + the frequency of the refresh. |
| 116 | + - the size of view (and the indexes is displayed) |
| 117 | + |
| 118 | + |image4| |
| 119 | + |
| 120 | +- Before applying the final step, you will need to add a specific |
| 121 | + Parent Menu to use when creating the UI Menu for the report. By |
| 122 | + default, it will be set with the ``SQL Views`` menu, which can be |
| 123 | + changed before creating the UI elements in order to have the report |
| 124 | + accessible from a different place within Odoo. |
| 125 | + |
| 126 | +- Finally, click on 'Create UI', to create new menu, action, graph view |
| 127 | + and search view. |
| 128 | + |
| 129 | +.. |image1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/bi_sql_editor/static/description/01_sql_request.png |
| 130 | +.. |image2| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/bi_sql_editor/static/description/02_security_access.png |
| 131 | +.. |image3| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/bi_sql_editor/static/description/03_field_mapping.png |
| 132 | +.. |image4| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/bi_sql_editor/static/description/04_materialized_view_setting.png |
| 133 | + |
| 134 | +Usage |
| 135 | +===== |
| 136 | + |
| 137 | +To use this module, you need to: |
| 138 | + |
| 139 | +1. Go to 'Dashboards > SQL Reports' |
| 140 | +2. Select the desired report |
| 141 | + |
| 142 | +.. |
| 143 | +
|
| 144 | + |usage-image1| |
| 145 | + |
| 146 | +- You can switch to 'Graph' or 'tree' views as any report. |
| 147 | + |
| 148 | +.. |usage-image1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/bi_sql_editor/static/description/05_reporting_pivot.png |
| 149 | + |
| 150 | +Bug Tracker |
| 151 | +=========== |
| 152 | + |
| 153 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_. |
| 154 | +In case of trouble, please check there if your issue has already been reported. |
| 155 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 156 | +`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20bi_sql_editor%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 157 | + |
| 158 | +Do not contact contributors directly about support or help with technical issues. |
| 159 | + |
| 160 | +Credits |
| 161 | +======= |
| 162 | + |
| 163 | +Authors |
| 164 | +------- |
| 165 | + |
| 166 | +* GRAP |
| 167 | + |
| 168 | +Contributors |
| 169 | +------------ |
| 170 | + |
| 171 | +- Sylvain LE GAL (https://twitter.com/legalsylvain) |
| 172 | + |
| 173 | +- Richard deMeester, WilldooIT (http://www.willdooit.com/) |
| 174 | + |
| 175 | +- David James, WilldooIT (http://www.willdooit.com/) |
| 176 | + |
| 177 | +- Guillem Casassas guillem.casassas@forgeflow.com |
| 178 | + |
| 179 | +- Thien Vo thienvh@trobz.com |
| 180 | + |
| 181 | +- This module is highly inspired by the work of |
| 182 | + |
| 183 | + - Onestein: (http://www.onestein.nl/) Module: |
| 184 | + OCA/server-tools/bi_view_editor. Link: |
| 185 | + https://github.com/OCA/reporting-engine/tree/9.0/bi_view_editor |
| 186 | + - Anybox: (https://anybox.fr/) Module : |
| 187 | + OCA/server-tools/materialized_sql_view link: |
| 188 | + https://github.com/OCA/server-tools/pull/110 |
| 189 | + - GRAP, Groupement Régional Alimentaire de Proximité: |
| 190 | + (http://www.grap.coop/) Module: |
| 191 | + grap/odoo-addons-misc/pos_sale_reporting link: |
| 192 | + https://github.com/grap/odoo-addons-misc/tree/7.0/pos_sale_reporting |
| 193 | + |
| 194 | +Other credits |
| 195 | +------------- |
| 196 | + |
| 197 | +The migration of this module from 17.0 to 18.0 was financially supported |
| 198 | +by Camptocamp. |
| 199 | + |
| 200 | +Maintainers |
| 201 | +----------- |
| 202 | + |
| 203 | +This module is maintained by the OCA. |
| 204 | + |
| 205 | +.. image:: https://odoo-community.org/logo.png |
| 206 | + :alt: Odoo Community Association |
| 207 | + :target: https://odoo-community.org |
| 208 | + |
| 209 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 210 | +mission is to support the collaborative development of Odoo features and |
| 211 | +promote its widespread use. |
| 212 | + |
| 213 | +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px |
| 214 | + :target: https://github.com/legalsylvain |
| 215 | + :alt: legalsylvain |
| 216 | + |
| 217 | +Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |
| 218 | + |
| 219 | +|maintainer-legalsylvain| |
| 220 | + |
| 221 | +This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/18.0/bi_sql_editor>`_ project on GitHub. |
| 222 | + |
| 223 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments