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.

184 lines
5.7 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. * Dynamically change displayed action name to mention the last refresh of the
  80. materialized view.
  81. * Create ir.rule to limit access. (for company_id for exemple)
  82. Note
  83. ====
  84. The syntax of the sql request has the following constrains:
  85. * the name of the selectable columns should be prefixed by `x_`
  86. Sample:
  87. .. code-block:: sql
  88. SELECT name as x_name
  89. FROM res_partner
  90. Bug Tracker
  91. ===========
  92. Bugs are tracked on `GitHub Issues
  93. <https://github.com/OCA/reporting-engine/issues>`_. In case of trouble, please
  94. check there if your issue has already been reported. If you spotted it first,
  95. help us smash it by providing detailed and welcomed feedback.
  96. Credits
  97. =======
  98. Contributors
  99. ------------
  100. * Sylvain LE GAL (https://twitter.com/legalsylvain)
  101. * This module is highly inspired by the work of
  102. * Onestein: (http://www.onestein.nl/)
  103. Module: OCA/server-tools/bi_view_editor.
  104. Link: https://github.com/OCA/reporting-engine/tree/8.0/bi_view_editor
  105. * Anybox: (https://anybox.fr/)
  106. Module : OCA/server-tools/materialized_sql_view
  107. link: https://github.com/OCA/server-tools/pull/110
  108. * GRAP, Groupement Régional Alimentaire de Proximité: (http://www.grap.coop/)
  109. Module: grap/odoo-addons-misc/pos_sale_reporting
  110. link: https://github.com/grap/odoo-addons-misc/tree/7.0/pos_sale_reporting
  111. Funders
  112. -------
  113. The development of this module has been financially supported by:
  114. * GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)
  115. Maintainer
  116. ----------
  117. .. image:: https://odoo-community.org/logo.png
  118. :alt: Odoo Community Association
  119. :target: https://odoo-community.org
  120. This module is maintained by the OCA.
  121. OCA, or the Odoo Community Association, is a nonprofit organization whose
  122. mission is to support the collaborative development of Odoo features and
  123. promote its widespread use.
  124. To contribute to this module, please visit https://odoo-community.org.