'Allow to render a QWeb template python-side. This function returns the \'ir.ui.view\'
render but embellish it with some variables/methods used in reports.
:param values: additionnal methods/variables used in the rendering
:returns: html representation of the template'

@api.multi
def render(self, template, values=None):

    if (values is None):
        values = {}
    context = dict(self.env.context, inherit_branding=True)
    user = self.env['res.users'].browse(self.env.uid)
    website = None
    if (request and hasattr(request, 'website')):
        if (request.website is not None):
            website = request.website
            context = dict(context, translatable=(context.get('lang') != request.website.default_lang_code))
    view_obj = self.env['ir.ui.view'].with_context(context)
    values.update(time=time, context_timestamp=(lambda t: fields.Datetime.context_timestamp(self.with_context(tz=user.tz), t)), editable=True, user=user, res_company=user.company_id, website=website, web_base_url=self.env['ir.config_parameter'].get_param('web.base.url', default=''))
    return view_obj.render_template(template, values)
