[MIG] module_analysis: Migration to 15.0

[MIG] module_analysis: Migration to 15.0
pull/2608/head
Juliette Blanc 2022-06-10 14:32:45 +02:00 committed by Florian da Costa
parent 34264f8466
commit acdd3c2773
7 changed files with 14 additions and 18 deletions

View File

@ -8,8 +8,8 @@
" to know which installed modules comes from Odoo Core, OCA, or are" " to know which installed modules comes from Odoo Core, OCA, or are"
" custom modules", " custom modules",
"author": "GRAP, Odoo Community Association (OCA)", "author": "GRAP, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-tools/", "website": "https://github.com/OCA/server-tools",
"version": "13.0.1.1.0", "version": "15.0.1.1.0",
"license": "AGPL-3", "license": "AGPL-3",
"depends": ["base"], "depends": ["base"],
"data": [ "data": [

View File

@ -8,9 +8,7 @@ from odoo import fields, models
class BaseModuleUpdate(models.TransientModel): class BaseModuleUpdate(models.TransientModel):
_inherit = "base.module.update" _inherit = "base.module.update"
analyse_installed_modules = fields.Boolean( analyse_installed_modules = fields.Boolean(default=True)
string="Analyse Installed Modules", default=True
)
def update_module(self): def update_module(self):
return super( return super(

View File

@ -9,7 +9,7 @@ class IrModuleAuthor(models.Model):
_name = "ir.module.author" _name = "ir.module.author"
_description = "Modules Authors" _description = "Modules Authors"
name = fields.Char(string="Name", required=True) name = fields.Char(required=True)
installed_module_ids = fields.Many2many( installed_module_ids = fields.Many2many(
string="Modules", string="Modules",

View File

@ -10,9 +10,9 @@ class IrModuleType(models.Model):
_description = "Modules Types" _description = "Modules Types"
_order = "sequence" _order = "sequence"
name = fields.Char(string="Name", required=True) name = fields.Char(required=True)
sequence = fields.Integer(string="Sequence") sequence = fields.Integer()
installed_module_ids = fields.One2many( installed_module_ids = fields.One2many(
string="Installed Modules", string="Installed Modules",

View File

@ -11,9 +11,9 @@ class IrModuleType(models.Model):
_description = "Modules Types Rules" _description = "Modules Types Rules"
_order = "sequence" _order = "sequence"
sequence = fields.Integer(string="Sequence") sequence = fields.Integer()
module_domain = fields.Char(string="Module Domain", required=True, default="[]") module_domain = fields.Char(required=True, default="[]")
module_type_id = fields.Many2one( module_type_id = fields.Many2one(
string="Module type", comodel_name="ir.module.type", required=True string="Module type", comodel_name="ir.module.type", required=True

View File

@ -6,9 +6,6 @@ from odoo import SUPERUSER_ID, api
def analyse_installed_modules(cr, registry): def analyse_installed_modules(cr, registry):
with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {})
env = api.Environment(cr, SUPERUSER_ID, {}) installed_modules = env["ir.module.module"].search([("state", "=", "installed")])
installed_modules = env["ir.module.module"].search( installed_modules.button_analyse_code()
[("state", "=", "installed")]
)
installed_modules.button_analyse_code()

View File

@ -2,10 +2,11 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase, post_install from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@post_install(True) @tagged("post_install", "-at_install")
class TestModule(TransactionCase): class TestModule(TransactionCase):
def setUp(self): def setUp(self):
super().setUp() super().setUp()