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.

186 lines
5.8 KiB

8 years ago
  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
  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/10.0
  76. Known issues / Roadmap
  77. ======================
  78. * Add 'interval', after type (row/col/measure) field for date(time) fields.
  79. * Possibly avoid the monkey patches
  80. Note
  81. ====
  82. * If the view is materialized, the name of the action will contain the date
  83. and the time of it last refresh:
  84. .. figure:: /bi_sql_editor/static/description/06_action_datetime_name.png
  85. :width: 800 px
  86. * The syntax of the sql request has the following constrains: the name of the
  87. selectable columns should be prefixed by `x_`
  88. Sample:
  89. .. code-block:: sql
  90. SELECT name as x_name
  91. FROM res_partner
  92. Bug Tracker
  93. ===========
  94. Bugs are tracked on `GitHub Issues
  95. <https://github.com/OCA/reporting-engine/issues>`_. In case of trouble, please
  96. check there if your issue has already been reported. If you spotted it first,
  97. help us smash it by providing detailed and welcomed feedback.
  98. Credits
  99. =======
  100. Contributors
  101. ------------
  102. * Sylvain LE GAL (https://twitter.com/legalsylvain)
  103. * This module is highly inspired by the work of
  104. * Onestein: (http://www.onestein.nl/)
  105. Module: OCA/server-tools/bi_view_editor.
  106. Link: https://github.com/OCA/reporting-engine/tree/9.0/bi_view_editor
  107. * Anybox: (https://anybox.fr/)
  108. Module : OCA/server-tools/materialized_sql_view
  109. link: https://github.com/OCA/server-tools/pull/110
  110. * GRAP, Groupement Régional Alimentaire de Proximité: (http://www.grap.coop/)
  111. Module: grap/odoo-addons-misc/pos_sale_reporting
  112. link: https://github.com/grap/odoo-addons-misc/tree/7.0/pos_sale_reporting
  113. Funders
  114. -------
  115. The development of this module has been financially supported by:
  116. * GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)
  117. Maintainer
  118. ----------
  119. .. image:: https://odoo-community.org/logo.png
  120. :alt: Odoo Community Association
  121. :target: https://odoo-community.org
  122. This module is maintained by the OCA.
  123. OCA, or the Odoo Community Association, is a nonprofit organization whose
  124. mission is to support the collaborative development of Odoo features and
  125. promote its widespread use.
  126. To contribute to this module, please visit https://odoo-community.org.