Ejemplo n.º 1
0
    def qweb(self, mods=None, db=None):
        files = [f[0] for f in controllers_main.manifest_glob('qweb', addons=mods, db=db)]
        last_modified = controllers_main.get_last_modified(files)
        if request.httprequest.if_modified_since and request.httprequest.if_modified_since >= last_modified:
            return controllers_main.werkzeug.wrappers.Response(status=304)

        content, checksum = controllers_main.concat_xml(files)
        if request.context['lang'] == 'en_US':
            content = content.decode('utf-8')
            content = request.env['ir.translation']._debrand(content)

        return controllers_main.make_conditional(
            request.make_response(content, [('Content-Type', 'text/xml')]),
            last_modified, checksum)
Ejemplo n.º 2
0
    def qweb(self, mods=None, db=None):
        files = [f[0] for f in controllers_main.manifest_glob('qweb', addons=mods, db=db)]
        last_modified = controllers_main.get_last_modified(files)
        if request.httprequest.if_modified_since and request.httprequest.if_modified_since >= last_modified:
            return controllers_main.werkzeug.wrappers.Response(status=304)

        content, checksum = controllers_main.concat_xml(files)
        if request.context['lang'] == 'en_US':
            content = content.decode('utf-8')
            content = self._debrand(content)

        return controllers_main.make_conditional(
            request.make_response(content, [('Content-Type', 'text/xml')]),
            last_modified, checksum)