Browse Source

Apply suggestions from code review

Co-Authored-By: David Beal <david.beal@akretion.com>
12.0
Sylvain LE GAL 5 years ago
committed by OCA-git-bot
parent
commit
df9c6cb727
  1. 2
      module_analysis/README.rst
  2. 7
      module_analysis/models/ir_module_module.py

2
module_analysis/README.rst

@ -106,7 +106,7 @@ files), create a custom modules and overload the module model :
@api.model
def _get_analyse_settings(self):
res = super(IrModuleModule, self)._get_analyse_settings()
res = super()._get_analyse_settings()
if not '.html' in res:
res['.html'] = {}
res['.html']['documentation'] 'xml_documentation_qty'

7
module_analysis/models/ir_module_module.py

@ -3,12 +3,9 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import os
# import json
import pygount
from pathlib import Path
import logging
# import os
# import subprocess
from odoo import api, fields, models
from odoo.tools.safe_eval import safe_eval
@ -83,14 +80,14 @@ class IrModuleModule(models.Model):
# Overload Section
@api.model
def update_list(self):
res = super(IrModuleModule, self).update_list()
res = super().update_list()
if self.env.context.get('analyse_installed_modules', False):
self.search([('state', '=', 'installed')]).button_analyse_code()
return res
@api.multi
def write(self, vals):
res = super(IrModuleModule, self).write(vals)
res = super().write(vals)
if vals.get('state', False) == 'installed':
self.button_analyse_code()
elif vals.get('state', False) == 'uninstalled'\

Loading…
Cancel
Save