Exemplo n.º 1
0
 def qweb(self, mods=None, db=None):
     files = [f[0] for f in manifest_glob('qweb', addons=mods, db=db)]
     last_modified = get_last_modified(files)
     if request.httprequest.if_modified_since and request.httprequest.if_modified_since >= last_modified:
         return werkzeug.wrappers.Response(status=304)
     content, checksum = concat_xml(files)
     if request.context and request.context.get('lang') == 'en_US':
         if request.session.db and request.env:
             content = request.env['muk_branding.debranding'].debrand(
                 content)
     return make_conditional(
         request.make_response(content, [('Content-Type', 'text/xml')]),
         last_modified, checksum)
Exemplo 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':
            # request.env could be not available
            content = debrand_bytes(request.session.db and request.env or None, content)

        return controllers_main.make_conditional(
            request.make_response(content, [('Content-Type', 'text/xml')]),
            last_modified, checksum)
Exemplo n.º 3
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':
            # request.env could be not available
            content = debrand_bytes(request.session.db and request.env or None,
                                    content)

        return controllers_main.make_conditional(
            request.make_response(content, [('Content-Type', 'text/xml')]),
            last_modified, checksum)
Exemplo n.º 4
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")
            # request.env could be not available
            content = debrand(request.session.db and request.env or None,
                              content)

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