From cc60504bffaa8f4fc142303947e98edd1b595973 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Thu, 26 Nov 2015 16:38:27 +0100 Subject: [PATCH] [FIX] base: only run postinstall tests for installed or updated modules Uninstalled modules are skipped with the filtering on the state. Fixes #9768, Closes #11378 --- openerp/modules/loading.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index 3d0ade8aa3ef1..5c357246c4186 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -453,7 +453,10 @@ def load_modules(db, force_demo=False, status=None, update_module=False): t0 = time.time() t0_sql = openerp.sql_db.sql_counter if openerp.tools.config['test_enable']: - cr.execute("SELECT name FROM ir_module_module WHERE state='installed'") + if update_module: + cr.execute("SELECT name FROM ir_module_module WHERE state='installed' and name = ANY(%s)", (processed_modules,)) + else: + cr.execute("SELECT name FROM ir_module_module WHERE state='installed'") for module_name in cr.fetchall(): report.record_result(openerp.modules.module.run_unit_tests(module_name[0], cr.dbname, position=runs_post_install)) _logger.log(25, "All post-tested in %.2fs, %s queries", time.time() - t0, openerp.sql_db.sql_counter - t0_sql)