[IMP] report: registration deprecation now guarded via openerp.conf.deprecation.
bzr revid: vmt@openerp.com-20130325131756-5bns19n20nar9ogs
This commit is contained in:
parent
464af881bf
commit
1ea66164f3
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue