'Render the template. If website is enabled on request, then extend rendering context with website values.'

@api.multi
def render(self, values=None, engine='ir.qweb'):

    new_context = dict(self._context)
    if (request and getattr(request, 'website_enabled', False)):
        qcontext = self._prepare_qcontext()
        if values:
            qcontext.update(values)
        if ((not qcontext.get('translatable')) and (not qcontext.get('rendering_bundle'))):
            if qcontext.get('editable'):
                new_context = dict(self._context, inherit_branding=True)
            elif request.env.user.has_group('website.group_website_publisher'):
                new_context = dict(self._context, inherit_branding_auto=True)
        if ('main_object' not in qcontext):
            qcontext['main_object'] = self
        values = qcontext
    if (self._context != new_context):
        self = self.with_context(new_context)
    return super(View, self).render(values, engine=engine)
