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.

185 lines
5.8 KiB

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