[FIX] Report: use ir.config 'report.url' key as base url if it exists

Browse ir.config 'report.url' with superuser as
the user may want to restrict access of this key to the public
This commit is contained in:
Simon Lejeune 2014-10-23 11:13:08 +02:00
parent 7ec7f1ba40
commit 440fb712cb
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@
##############################################################################
from openerp import api
from openerp import SUPERUSER_ID
from openerp.exceptions import AccessError
from openerp.osv import osv
from openerp.tools import config, which
@ -199,7 +200,8 @@ class Report(osv.Model):
headerhtml = []
contenthtml = []
footerhtml = []
base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url')
irconfig_obj = self.pool['ir.config_parameter']
base_url = irconfig_obj.get_param(cr, SUPERUSER_ID, 'report.url') or irconfig_obj.get_param(cr, SUPERUSER_ID, 'web.base.url')
# Minimal page renderer
view_obj = self.pool['ir.ui.view']