From 1ea66164f30437a176e72cdc453c307e7c66b3f5 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Mon, 25 Mar 2013 14:17:56 +0100 Subject: [PATCH] [IMP] report: registration deprecation now guarded via openerp.conf.deprecation. bzr revid: vmt@openerp.com-20130325131756-5bns19n20nar9ogs --- openerp/conf/deprecation.py | 9 +++++++-- openerp/report/interface.py | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openerp/conf/deprecation.py b/openerp/conf/deprecation.py index fec2fbbf224..66ddfc441d4 100644 --- a/openerp/conf/deprecation.py +++ b/openerp/conf/deprecation.py @@ -43,8 +43,13 @@ open_openerp_namespace = False # Among the related code: # - The openerp.netsvc.LocalService() function. # - The openerp.report.interface.report_int._reports dictionary. -# - The register attribute in openerp.report.report_sxw (and in its inheriting -# classes). +# - The register attribute in openerp.report.interface.report_int (and in its +# inheriting classes). allow_local_service = True +# Applies for the register attribute in openerp.report.interface.report_int. +# See comments for allow_local_service above. +# Introduced around 2013.03. +allow_report_int_registration = True + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/report/interface.py b/openerp/report/interface.py index d6d90b17d42..2f3a89a913b 100644 --- a/openerp/report/interface.py +++ b/openerp/report/interface.py @@ -45,6 +45,8 @@ class report_int(object): def __init__(self, name, register=True): if register: + import openerp + assert openerp.conf.deprecation.allow_report_int_registration assert name.startswith('report.'), 'Report names should start with "report.".' assert name not in self._reports, 'The report "%s" already exists.' % name self._reports[name] = self