From 43419ed6e9ec4dc3edbcc121055e4148260fdeb2 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 19 Mar 2014 09:49:31 +0100 Subject: [PATCH 1/8] [IMP] Allow openerp.tools.convert_file() to optionally take the full path name bzr revid: fme@openerp.com-20140319084931-1ipjqi2dd3ug7i2t --- openerp/tools/convert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py index 43ee96660bd..eb7652f3737 100644 --- a/openerp/tools/convert.py +++ b/openerp/tools/convert.py @@ -952,8 +952,9 @@ form: module.record_id""" % (xml_id,) 'url': self._tag_url } -def convert_file(cr, module, filename, idref, mode='update', noupdate=False, kind=None, report=None): - pathname = os.path.join(module, filename) +def convert_file(cr, module, filename, idref, mode='update', noupdate=False, kind=None, report=None, pathname=None): + if pathname is None: + pathname = os.path.join(module, filename) fp = misc.file_open(pathname) ext = os.path.splitext(filename)[1].lower() try: From 46cfd8940f7f3f0557335538892389751730ee6d Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 19 Mar 2014 09:54:54 +0100 Subject: [PATCH 2/8] [FIX] doc typo bzr revid: fme@openerp.com-20140319085454-1pnjm55b4vxfm1wc --- openerp/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index 4f6a6cdd86a..0dc5e86171b 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -1027,7 +1027,7 @@ class Root(object): return self.dispatch(environ, start_response) def load_addons(self): - """ Load all addons from addons patch containg static files and + """ Load all addons from addons path containing static files and controllers and configure them. """ statics = {} From 14c3ffcb39e860e0f893d2727b4129eeea87244d Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 19 Mar 2014 09:57:08 +0100 Subject: [PATCH 3/8] [IMP] Allow openerp.modules.load_information_from_description_file() to take an optional mod_path argument bzr revid: fme@openerp.com-20140319085708-prrs0m4gjvuu4o86 --- openerp/modules/module.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 8958813baa2..b0b7e0aeb94 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -169,13 +169,15 @@ def get_module_icon(module): return ('/' + module + '/') + '/'.join(iconpath) return '/base/' + '/'.join(iconpath) -def load_information_from_description_file(module): +def load_information_from_description_file(module, mod_path=None): """ :param module: The name of the module (sale, purchase, ...) + :param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...) """ - terp_file = get_module_resource(module, '__openerp__.py') - mod_path = get_module_path(module) + if not mod_path: + mod_path = get_module_path(module) + terp_file = opj(mod_path, '__openerp__.py') if terp_file: info = {} if os.path.isfile(terp_file): From b8368d8182a582707bca3a77de8ae002e3217622 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 20 Mar 2014 16:03:48 +0100 Subject: [PATCH 4/8] [WIP] added virtual field. will probably change the name of this field bzr revid: fme@openerp.com-20140320150348-5tv7j2he26mhqpco --- openerp/addons/base/module/module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index 6ad74857f39..84dbbd3b89d 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -292,6 +292,7 @@ class module(osv.osv): 'reports_by_module': fields.function(_get_views, string='Reports', type='text', multi="meta", store=True), 'views_by_module': fields.function(_get_views, string='Views', type='text', multi="meta", store=True), 'application': fields.boolean('Application', readonly=True), + 'virtual': fields.boolean('Virtual module', readonly=True), 'icon': fields.char('Icon URL', size=128), 'icon_image': fields.function(_get_icon_image, string='Icon', type="binary"), } @@ -301,6 +302,7 @@ class module(osv.osv): 'sequence': 100, 'demo': False, 'license': 'AGPL-3', + 'virtual': False, } _order = 'sequence,name' From 0f9905b9f1b0736297f55dfd222123a2ae4134f1 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 20 Mar 2014 16:36:51 +0100 Subject: [PATCH 5/8] [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) From 4d850cdbc9e2f6a158c2cabaa257867fc776082c Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 26 Mar 2014 17:01:50 +0100 Subject: [PATCH 6/8] [REV] revert refresh_routing_map bzr revid: fme@openerp.com-20140326160150-daoc6fypcmckyynk --- openerp/addons/base/ir/ir_http.py | 5 ----- openerp/modules/loading.py | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/openerp/addons/base/ir/ir_http.py b/openerp/addons/base/ir/ir_http.py index ede0d7a2e02..62ecd605223 100644 --- a/openerp/addons/base/ir/ir_http.py +++ b/openerp/addons/base/ir/ir_http.py @@ -145,11 +145,6 @@ 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 4f44f9bd38d..5635e42e780 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -187,9 +187,11 @@ 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) From e6aadeb58ce13b5c340b7dc21c098840bc83605a Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 27 Mar 2014 11:38:44 +0100 Subject: [PATCH 7/8] [FIX] Set correct record id for