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.

192 lines
6.0 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. Installation
  37. ============
  38. * You must put this module as `server_wide_modules` in your odoo configuration file
  39. or add '--load=bi_sql_editor' if you start odoo in command line.
  40. Configuration
  41. =============
  42. To configure this module, you need to:
  43. * Go to Settings / Technical / Database Structure / SQL Views
  44. * tip your SQL request
  45. .. figure:: /bi_sql_editor/static/description/01_sql_request.png
  46. :width: 800 px
  47. * Select the group(s) that could have access to the view
  48. .. figure:: /bi_sql_editor/static/description/02_security_access.png
  49. :width: 800 px
  50. * Click on the button 'Clean and Check Request'
  51. * Once the sql request checked, the module analyses the column of the view,
  52. and propose field mapping. For each field, you can decide to create an index
  53. and set if it will be displayed on the pivot graph as a column, a row or a
  54. measure.
  55. .. figure:: /bi_sql_editor/static/description/03_field_mapping.png
  56. :width: 800 px
  57. * Click on the button 'Create SQL View, Indexes and Models'. (this step could
  58. take a while, if view is materialized)
  59. * If it's a MATERIALIZED view:
  60. * a cron task is created to refresh
  61. the view. You can so define the frequency of the refresh.
  62. * the size of view (and the indexes is displayed)
  63. .. figure:: /bi_sql_editor/static/description/04_materialized_view_setting.png
  64. :width: 800 px
  65. * Finally, click on 'Create UI', to create new menu, action, graph view and
  66. search view.
  67. Usage
  68. =====
  69. To use this module, you need to:
  70. #. Go to 'Reporting' / 'Custom Reports'
  71. #. Select the desired report
  72. .. figure:: /bi_sql_editor/static/description/05_reporting_pivot.png
  73. :width: 800 px
  74. * You can switch to 'Pie' chart or 'Line Chart' as any report,
  75. .. figure:: /bi_sql_editor/static/description/05_reporting_pie.png
  76. :width: 800 px
  77. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  78. :alt: Try me on Runbot
  79. :target: https://runbot.odoo-community.org/runbot/143/10.0
  80. Known issues / Roadmap
  81. ======================
  82. * Add 'interval', after type (row/col/measure) field for date(time) fields.
  83. * Possibly avoid the monkey patches
  84. Note
  85. ====
  86. * If the view is materialized, the name of the action will contain the date
  87. and the time of it last refresh:
  88. .. figure:: /bi_sql_editor/static/description/06_action_datetime_name.png
  89. :width: 800 px
  90. * The syntax of the sql request has the following constrains: the name of the
  91. selectable columns should be prefixed by `x_`
  92. Sample:
  93. .. code-block:: sql
  94. SELECT name as x_name
  95. FROM res_partner
  96. Bug Tracker
  97. ===========
  98. Bugs are tracked on `GitHub Issues
  99. <https://github.com/OCA/reporting-engine/issues>`_. In case of trouble, please
  100. check there if your issue has already been reported. If you spotted it first,
  101. help us smash it by providing detailed and welcomed feedback.
  102. Credits
  103. =======
  104. Contributors
  105. ------------
  106. * Sylvain LE GAL (https://twitter.com/legalsylvain)
  107. * This module is highly inspired by the work of
  108. * Onestein: (http://www.onestein.nl/)
  109. Module: OCA/server-tools/bi_view_editor.
  110. Link: https://github.com/OCA/reporting-engine/tree/9.0/bi_view_editor
  111. * Anybox: (https://anybox.fr/)
  112. Module : OCA/server-tools/materialized_sql_view
  113. link: https://github.com/OCA/server-tools/pull/110
  114. * GRAP, Groupement Régional Alimentaire de Proximité: (http://www.grap.coop/)
  115. Module: grap/odoo-addons-misc/pos_sale_reporting
  116. link: https://github.com/grap/odoo-addons-misc/tree/7.0/pos_sale_reporting
  117. Funders
  118. -------
  119. The development of this module has been financially supported by:
  120. * GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)
  121. Maintainer
  122. ----------
  123. .. image:: https://odoo-community.org/logo.png
  124. :alt: Odoo Community Association
  125. :target: https://odoo-community.org
  126. This module is maintained by the OCA.
  127. OCA, or the Odoo Community Association, is a nonprofit organization whose
  128. mission is to support the collaborative development of Odoo features and
  129. promote its widespread use.
  130. To contribute to this module, please visit https://odoo-community.org.