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.

182 lines
6.0 KiB

  1. ===============
  2. Module Analysis
  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%2Fserver--tools-lightgray.png?logo=github
  15. :target: https://github.com/OCA/server-tools/tree/12.0/module_analysis
  16. :alt: OCA/server-tools
  17. .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
  18. :target: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-module_analysis
  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/149/12.0
  22. :alt: Try me on Runbot
  23. |badge1| |badge2| |badge3| |badge4| |badge5|
  24. This module allows you to know 'how much code' is running on your Odoo
  25. instance, group by 'Type' (Odoo Core, OCA, other...)
  26. This module can be usefull in the following cases :
  27. * To analyse the size of your technical debt, regarding your Custom modules
  28. * To know the ratio between Odoo / OCA and Custom modules
  29. * To evaluate the amount to pay to odoo to upgrade your custom code, or the
  30. induced workload
  31. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/installed_modules_by_types.png
  32. For that purpose, it adds new concepts
  33. * ``ir.module.author``, based on the value ``author`` present in the manifest
  34. file.
  35. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/module_authors.png
  36. * ``ir.module.type``, populated by default with Odoo and OCA values.
  37. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/module_types.png
  38. Each installed modules have extra data in the 'Technical Data' tab :
  39. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/module_form.png
  40. **Table of contents**
  41. .. contents::
  42. :local:
  43. Installation
  44. ============
  45. To use this module, you have to install the ``pygount`` python librairy.
  46. ``pip install pygount``
  47. Configuration
  48. =============
  49. * Go to Apps / Module Analysis / Modules Types Rules
  50. The Module types Rules are usefull to get the Type of a module, based on
  51. it information.
  52. This module comes with default rules.
  53. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/default_module_type_rules.png
  54. You can add your custom rules to identify the modules your team have
  55. developped for exemple,
  56. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/add_module_type_rules.png
  57. to update the data, you have to :
  58. * Go to 'Apps' / 'Update Apps List'
  59. * Check the box 'Analyse Installed modules'
  60. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/base_module_update.png
  61. This will update analysis of your installed modules.
  62. Adding Extra data
  63. ~~~~~~~~~~~~~~~~~
  64. If you want to analyse other data, (for exemple, having the number of HTML
  65. files), create a custom modules and overload the module model :
  66. .. code-block:: python
  67. from odoo import api, fields, models
  68. class IrModuleModule(models.Model):
  69. _inherit = 'ir.module.module'
  70. xml_documentation_qty = fields.Integer(
  71. string='Quantity of Comments in XML Files')
  72. @api.model
  73. def _get_analyse_settings(self):
  74. res = super()._get_analyse_settings()
  75. if not '.html' in res:
  76. res['.html'] = {}
  77. res['.html']['documentation'] 'xml_documentation_qty'
  78. return res
  79. Exclude files and directories
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. Two parameters are availaible in 'Settings' / 'Technical' / 'Parameters'
  82. 'System Parameters' :
  83. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/config_parameters.png
  84. The list of folders and filename will be exclude from the analysis.
  85. You can change the default settings.
  86. Usage
  87. =====
  88. * Go to 'Apps' / 'Module Analysis' / 'Installed module by Types'
  89. Open the stats to analyse the detail of the code installed
  90. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/analysis_pivot.png
  91. .. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/module_analysis/static/description/analysis_pie.png
  92. Bug Tracker
  93. ===========
  94. Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
  95. In case of trouble, please check there if your issue has already been reported.
  96. If you spotted it first, help us smashing it by providing a detailed and welcomed
  97. `feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20module_analysis%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  98. Do not contact contributors directly about support or help with technical issues.
  99. Credits
  100. =======
  101. Authors
  102. ~~~~~~~
  103. * GRAP
  104. Contributors
  105. ~~~~~~~~~~~~
  106. * Sylvain LE GAL (https://twitter.com/legalsylvain)
  107. Maintainers
  108. ~~~~~~~~~~~
  109. This module is maintained by the OCA.
  110. .. image:: https://odoo-community.org/logo.png
  111. :alt: Odoo Community Association
  112. :target: https://odoo-community.org
  113. OCA, or the Odoo Community Association, is a nonprofit organization whose
  114. mission is to support the collaborative development of Odoo features and
  115. promote its widespread use.
  116. This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/12.0/module_analysis>`_ project on GitHub.
  117. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.