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