|
| 1 | +=============== |
| 2 | +Module Analysis |
| 3 | +=============== |
| 4 | + |
| 5 | +.. |
| 6 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 7 | + !! This file is generated by oca-gen-addon-readme !! |
| 8 | + !! changes will be overwritten. !! |
| 9 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 10 | + !! source digest: sha256:ae67870974ac7792dd300cb5ec41ece9c1bd971fff46551b50c790a809bf954a |
| 11 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 12 | +
|
| 13 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 14 | + :target: https://odoo-community.org/page/development-status |
| 15 | + :alt: Beta |
| 16 | +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
| 17 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 18 | + :alt: License: AGPL-3 |
| 19 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github |
| 20 | + :target: https://github.com/OCA/server-tools/tree/18.0/module_analysis |
| 21 | + :alt: OCA/server-tools |
| 22 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 23 | + :target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-module_analysis |
| 24 | + :alt: Translate me on Weblate |
| 25 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 26 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0 |
| 27 | + :alt: Try me on Runboat |
| 28 | + |
| 29 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 30 | + |
| 31 | +This module allows you to know 'how much code' is running on your Odoo |
| 32 | +instance, group by 'Type' (Odoo Core, OCA, other...) |
| 33 | + |
| 34 | +This module can be usefull in the following cases : |
| 35 | + |
| 36 | +- To analyse the size of your technical debt, regarding your Custom |
| 37 | + modules |
| 38 | +- To know the ratio between Odoo / OCA and Custom modules |
| 39 | +- To evaluate the amount to pay to odoo to upgrade your custom code, or |
| 40 | + the induced workload |
| 41 | + |
| 42 | +|installed_modules_by_types| |
| 43 | + |
| 44 | +For that purpose, it adds new concepts |
| 45 | + |
| 46 | +- ``ir.module.author``, based on the value ``author`` present in the |
| 47 | + manifest file. |
| 48 | + |
| 49 | +|module_authors| |
| 50 | + |
| 51 | +- ``ir.module.type``, populated by default with Odoo and OCA values. |
| 52 | + |
| 53 | +|module_types| |
| 54 | + |
| 55 | +Each installed modules have extra data in the 'Technical Data' tab : |
| 56 | + |
| 57 | +|module_form| |
| 58 | + |
| 59 | +.. |installed_modules_by_types| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/installed_modules_by_types.png |
| 60 | +.. |module_authors| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/module_authors.png |
| 61 | +.. |module_types| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/module_types.png |
| 62 | +.. |module_form| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/module_form.png |
| 63 | + |
| 64 | +**Table of contents** |
| 65 | + |
| 66 | +.. contents:: |
| 67 | + :local: |
| 68 | + |
| 69 | +Installation |
| 70 | +============ |
| 71 | + |
| 72 | +To use this module, you have to install the ``pygount`` python librairy. |
| 73 | + |
| 74 | +``pip install pygount`` |
| 75 | + |
| 76 | +Configuration |
| 77 | +============= |
| 78 | + |
| 79 | +- Go to Apps / Module Analysis / Modules Types Rules |
| 80 | + |
| 81 | +The Module types Rules are usefull to get the Type of a module, based on |
| 82 | +it information. |
| 83 | + |
| 84 | +This module comes with default rules. |
| 85 | + |
| 86 | + |default_module_type_rules| |
| 87 | + |
| 88 | +You can add your custom rules to identify the modules your team have |
| 89 | +developped for exemple, |
| 90 | + |
| 91 | + |add_module_type_rules| |
| 92 | + |
| 93 | +to update the data manually, you have to : |
| 94 | + |
| 95 | +- Go to 'Settings' / 'Technical' / 'Scheduled Actions' |
| 96 | +- Run manually the action : 'Update Module Analysis' |
| 97 | + |
| 98 | +This will update analysis of your installed modules. |
| 99 | + |
| 100 | +to update the data automatically, you have to : |
| 101 | + |
| 102 | +- Go to 'Settings' / 'Technical' / 'Scheduled Actions' |
| 103 | +- Configure the action 'Update Module Analysis' and activate it. (By |
| 104 | + default, the cron is unactive and no analysis is done) |
| 105 | + |
| 106 | +Adding Extra data |
| 107 | +----------------- |
| 108 | + |
| 109 | +If you want to analyse other data, (for exemple, having the number of |
| 110 | +HTML files), create a custom modules and overload the module model : |
| 111 | + |
| 112 | +.. code:: python |
| 113 | +
|
| 114 | + from odoo import api, fields, models |
| 115 | +
|
| 116 | + class IrModuleModule(models.Model): |
| 117 | + _inherit = 'ir.module.module' |
| 118 | +
|
| 119 | + xml_documentation_qty = fields.Integer( |
| 120 | + string='Quantity of Comments in XML Files') |
| 121 | +
|
| 122 | + @api.model |
| 123 | + def _get_analyse_settings(self): |
| 124 | + res = super()._get_analyse_settings() |
| 125 | + if not '.html' in res: |
| 126 | + res['.html'] = {} |
| 127 | + res['.html']['documentation'] 'xml_documentation_qty' |
| 128 | + return res |
| 129 | +
|
| 130 | +Exclude files and directories |
| 131 | +----------------------------- |
| 132 | + |
| 133 | +Two parameters are availaible in 'Settings' / 'Technical' / 'Parameters' |
| 134 | +'System Parameters' : |
| 135 | + |
| 136 | + |config_parameters| |
| 137 | + |
| 138 | +The list of folders and filename will be exclude from the analysis. You |
| 139 | +can change the default settings. |
| 140 | + |
| 141 | +.. |default_module_type_rules| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/default_module_type_rules.png |
| 142 | +.. |add_module_type_rules| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/add_module_type_rules.png |
| 143 | +.. |config_parameters| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/config_parameters.png |
| 144 | + |
| 145 | +Usage |
| 146 | +===== |
| 147 | + |
| 148 | +- Go to 'Apps' / 'Module Analysis' / 'Installed module by Types' |
| 149 | + |
| 150 | +Open the stats to analyse the detail of the code installed |
| 151 | + |
| 152 | + |analysis_pivot| |
| 153 | + |
| 154 | + |analysis_pie| |
| 155 | + |
| 156 | +.. |analysis_pivot| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/analysis_pivot.png |
| 157 | +.. |analysis_pie| image:: https://raw.githubusercontent.com/OCA/server-tools/18.0/module_analysis/static/description/analysis_pie.png |
| 158 | + |
| 159 | +Bug Tracker |
| 160 | +=========== |
| 161 | + |
| 162 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_. |
| 163 | +In case of trouble, please check there if your issue has already been reported. |
| 164 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 165 | +`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20module_analysis%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 166 | + |
| 167 | +Do not contact contributors directly about support or help with technical issues. |
| 168 | + |
| 169 | +Credits |
| 170 | +======= |
| 171 | + |
| 172 | +Authors |
| 173 | +------- |
| 174 | + |
| 175 | +* GRAP |
| 176 | + |
| 177 | +Contributors |
| 178 | +------------ |
| 179 | + |
| 180 | +- Sylvain LE GAL (https://twitter.com/legalsylvain) |
| 181 | + |
| 182 | +Maintainers |
| 183 | +----------- |
| 184 | + |
| 185 | +This module is maintained by the OCA. |
| 186 | + |
| 187 | +.. image:: https://odoo-community.org/logo.png |
| 188 | + :alt: Odoo Community Association |
| 189 | + :target: https://odoo-community.org |
| 190 | + |
| 191 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 192 | +mission is to support the collaborative development of Odoo features and |
| 193 | +promote its widespread use. |
| 194 | + |
| 195 | +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px |
| 196 | + :target: https://github.com/legalsylvain |
| 197 | + :alt: legalsylvain |
| 198 | + |
| 199 | +Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |
| 200 | + |
| 201 | +|maintainer-legalsylvain| |
| 202 | + |
| 203 | +This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/module_analysis>`_ project on GitHub. |
| 204 | + |
| 205 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments