From 0f9905b9f1b0736297f55dfd222123a2ae4134f1 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 20 Mar 2014 16:36:51 +0100 Subject: [PATCH] [IMP] better syntax for routing_map cache invalidation bzr revid: fme@openerp.com-20140320153651-4lkoekzhawny0p85 --- openerp/addons/base/ir/ir_http.py | 5 +++++ openerp/modules/loading.py | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/ir/ir_http.py b/openerp/addons/base/ir/ir_http.py index 62ecd605223..ede0d7a2e02 100644 --- a/openerp/addons/base/ir/ir_http.py +++ b/openerp/addons/base/ir/ir_http.py @@ -145,6 +145,11 @@ class ir_http(osv.AbstractModel): return self._routing_map + def refresh_routing_map(self): + if hasattr(ir_http, '_routing_map'): + del(ir_http._routing_map) + return self.routing_map() + def convert_exception_to(to_type, with_message=False): """ Should only be called from an exception handler. Fetches the current exception data from sys.exc_info() and creates a new exception of type diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index 681d8534c05..979917df1a2 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -186,11 +186,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= if tools.config.options['test_enable']: # Yamel test report.record_result(load_test(module_name, idref, mode)) + # Force routing map to be rebuilt between each test suite on modules + registry['ir.http'].refresh_routing_map() # Python tests - ir_http = registry['ir.http'] - if hasattr(ir_http, '_routing_map'): - # Force routing map to be rebuilt between each module test suite - del(ir_http._routing_map) report.record_result(openerp.modules.module.run_unit_tests(module_name, cr.dbname)) processed_modules.append(package.name)