OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

208 lines
6.9 KiB

7 years ago
  1. =============
  2. BI SQL Editor
  3. =============
  4. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  5. !! This file is generated by oca-gen-addon-readme !!
  6. !! changes will be overwritten. !!
  7. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8. .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
  9. :target: https://odoo-community.org/page/development-status
  10. :alt: Beta
  11. .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
  12. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  13. :alt: License: AGPL-3
  14. .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
  15. :target: https://github.com/OCA/reporting-engine/tree/12.0/bi_sql_editor
  16. :alt: OCA/reporting-engine
  17. .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
  18. :target: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-bi_sql_editor
  19. :alt: Translate me on Weblate
  20. .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
  21. :target: https://runbot.odoo-community.org/runbot/143/12.0
  22. :alt: Try me on Runbot
  23. |badge1| |badge2| |badge3| |badge4| |badge5|
  24. This module extends the functionality of reporting, to support creation
  25. of extra custom reports.
  26. It allows user to write a custom SQL request. (Generally, admin users)
  27. Once written, a new model is generated, and user can map the selected field
  28. with odoo fields.
  29. Then user ends the process, creating new menu, action and graph view.
  30. Technically, the module create SQL View (or materialized view, if option is
  31. checked). Materialized view duplicates datas, but request are fastest. If
  32. materialized view is enabled, this module will create a cron task to refresh
  33. the data).
  34. By default, users member of 'SQL Request / User' can see all the views.
  35. You can specify extra groups that have the right to access to a specific view.
  36. Warning
  37. -------
  38. This module is intended for technician people in a company and for Odoo integrators.
  39. It requires the user to know SQL syntax and Odoo models.
  40. If you don't have such skills, do not try to use this module specially on a production
  41. environment.
  42. Use Cases
  43. ---------
  44. this module is interesting for the following use cases
  45. * You want to realize technical SQL requests, that Odoo framework doesn't allow
  46. (For exemple, UNION with many SELECT) A typical use case is if you want to have
  47. Sale Orders and PoS Orders datas in a same table
  48. * You want to customize an Odoo report, removing some useless fields and adding
  49. some custom ones. In that case, you can simply select the fields of the original
  50. report (sale.report model for exemple), and add your custom fields
  51. * You have a lot of data, and classical SQL Views have very bad performance.
  52. In that case, MATERIALIZED VIEW will be a good solution to reduce display duration
  53. **Table of contents**
  54. .. contents::
  55. :local:
  56. Configuration
  57. =============
  58. To configure this module, you need to:
  59. * Go to Settings / Technical / Database Structure / SQL Views
  60. * tip your SQL request
  61. .. figure:: /bi_sql_editor/static/description/01_sql_request.png
  62. :width: 800 px
  63. * Select the group(s) that could have access to the view
  64. .. figure:: /bi_sql_editor/static/description/02_security_access.png
  65. :width: 800 px
  66. * Click on the button 'Clean and Check Request'
  67. * Once the sql request checked, the module analyses the column of the view,
  68. and propose field mapping. For each field, you can decide to create an index
  69. and set if it will be displayed on the pivot graph as a column, a row or a
  70. measure.
  71. .. figure:: /bi_sql_editor/static/description/03_field_mapping.png
  72. :width: 800 px
  73. * Click on the button 'Create SQL View, Indexes and Models'. (this step could
  74. take a while, if view is materialized)
  75. * If it's a MATERIALIZED view:
  76. * a cron task is created to refresh
  77. the view. You can so define the frequency of the refresh.
  78. * the size of view (and the indexes is displayed)
  79. .. figure:: /bi_sql_editor/static/description/04_materialized_view_setting.png
  80. :width: 800 px
  81. * Finally, click on 'Create UI', to create new menu, action, graph view and
  82. search view.
  83. Usage
  84. =====
  85. To use this module, you need to:
  86. #. Go to 'Reporting' / 'Custom Reports'
  87. #. Select the desired report
  88. .. figure:: /bi_sql_editor/static/description/05_reporting_pivot.png
  89. :width: 800 px
  90. * You can switch to 'Pie' chart or 'Line Chart' as any report,
  91. .. figure:: /bi_sql_editor/static/description/05_reporting_pie.png
  92. :width: 800 px
  93. Bug Tracker
  94. ===========
  95. Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
  96. In case of trouble, please check there if your issue has already been reported.
  97. If you spotted it first, help us smashing it by providing a detailed and welcomed
  98. `feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20bi_sql_editor%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  99. Do not contact contributors directly about support or help with technical issues.
  100. Note
  101. ====
  102. * If the view is materialized, the name of the action will contain the date
  103. and the time of it last refresh:
  104. .. figure:: /bi_sql_editor/static/description/06_action_datetime_name.png
  105. :width: 800 px
  106. * The syntax of the sql request has the following constrains: the name of the
  107. selectable columns should be prefixed by `x_`
  108. Sample:
  109. .. code-block:: sql
  110. SELECT name as x_name
  111. FROM res_partner
  112. Credits
  113. =======
  114. Authors
  115. ~~~~~~~
  116. * GRAP
  117. Contributors
  118. ~~~~~~~~~~~~
  119. * Sylvain LE GAL (https://twitter.com/legalsylvain)
  120. * This module is highly inspired by the work of
  121. * Onestein: (http://www.onestein.nl/)
  122. Module: OCA/server-tools/bi_view_editor.
  123. Link: https://github.com/OCA/reporting-engine/tree/9.0/bi_view_editor
  124. * Anybox: (https://anybox.fr/)
  125. Module : OCA/server-tools/materialized_sql_view
  126. link: https://github.com/OCA/server-tools/pull/110
  127. * GRAP, Groupement Régional Alimentaire de Proximité: (http://www.grap.coop/)
  128. Module: grap/odoo-addons-misc/pos_sale_reporting
  129. link: https://github.com/grap/odoo-addons-misc/tree/7.0/pos_sale_reporting
  130. Funders
  131. ~~~~~~~
  132. The development of this module has been financially supported by:
  133. * GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)
  134. Maintainers
  135. ~~~~~~~~~~~
  136. This module is maintained by the OCA.
  137. .. image:: https://odoo-community.org/logo.png
  138. :alt: Odoo Community Association
  139. :target: https://odoo-community.org
  140. OCA, or the Odoo Community Association, is a nonprofit organization whose
  141. mission is to support the collaborative development of Odoo features and
  142. promote its widespread use.
  143. This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/12.0/bi_sql_editor>`_ project on GitHub.
  144. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.